Jump to content

Re-arranging word in a sentence.


Recommended Posts

Hey guy's

I posted this earlier on another forum and I got advised to go here. In the latest quote, a fellow forum member gives advice on the way it needs to be processed, maybe this helps out.

This is the post:

I am working on a book for a school project, it contains a large portion of text which is in english, but I want to write it like an arabic sentence. This means you have to read the sentence from right to left
 

example an is this


It is way to much text to re-write it, I am looking for some software that can do this for me, is anyone familiar with such software?

Thanks in advance!

Jordy

===

I got this advice from a fellow forum member:
 

(Today 12:17 PM)DuguWudi Wrote: 

I just finish dinner, during eating I figure out how you can do it but you need someone familiar with autoit.




Pseudo code procedure


------------------------


Step 1


-------


"Hi I am Jordy and I am on HF" use StringReverse to become


"FH no ma I dna ydroJ ma I iH".



Step 2


-------


Use StringSplit on "FH no ma I dna ydroJ ma I iH" using space as delimiters and separate them into word for word(separate string1,string2..., then use a for loop to loop each string and use stringreverse again but this time on each word(string1,string2...) not whole sentence.



Step 3


-------


The final result would be


"HF on am I and Jordy am I Hi"



You ask for help in the autoit section here or in official autoit forum, maybe someone can create a simple autoit script for you.



In this example the following is used:

Regular sentence:
Hi I am Jordy and I am on HF

This is what I want it to look like
HF on am I and Jordy am I Hi

===
 

 

Would love to get some help!

Link to comment
Share on other sites

Unicode to the rescue:

Local $s = "Hi I am Jordy and I am on HF"
$s = ChrW(0x202e) & $s & ChrW(0x202d)
MsgBox(0, "", $s & @LF)

 

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

Wow, cool solution :)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Those are backwards words though?

#include<array.au3>
Local $s = "Hi I am Jordy and I am on HF"
Local $a = stringsplit($s , " " , 2)
_ArrayReverse($a)
msgbox(0, '' , _ArrayToString($a , " "))

 

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...