Michael Lugassy wrote:

> works great in english, but gives the same errors on my hebrew data.
> Apperantly hebrew is somehow diffrent, I'll try to explain what I see.
> 
> I see sentence which need to be no. 1 sometimes starting alright, but
> sentence
> number 2 starts after sentence number 3.
> 
> Let's say if I would've tried something like this (in hebrew):
> I hate dogs. They leave out hair and barks. And also Cats. You know I hate
> cats.
> 
> I would've gotten: I hate dogs. And also Cats. They leave out hair and
> barks. You ...
> and sometimes:
> And also Cats. I hate dogs. They leave out hair and barks. You know...
> 
> Any thoughts on why this is not consistent?

Could it be that there are some other characters that denote the end of 
a sentence??? Here is my 2 cents:
- use the Reverse() function for each string that needs to be reversed.
- use not just . but .?! to split into lines
- use a temporary delimiter to make sure you keep the right punctuation

After that, code looks like this:
<cfset fulltext = REReplaceNoCase(fulltext,"[.?!]","\|\1","All">
<cfloop list="#fulltext#" delimiters="|" index="currentsentence">
   <cfoutput>#Reverse(currentsentence)#</cfoutput>
</cfloop>

If you can think of any other character that denotes the end of a line 
just add them to the regular expression.

Jochem


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to