Find expression--alphabets

For all things Mellel

Moderators: Eyal Redler, redlers, Ori Redler

Post Reply
jb
Read the guide, knows everything
Posts: 51
Joined: Mon Aug 21, 2006 5:05 pm

Find expression--alphabets

Post by jb »

I often work with documents containing characters (words) in two alphabets (Greek and Roman). When these two alphabets happen to be produced in the same font (Lucida Grande, say) simply by switching keyboards, I know of no way to produce a Find expression that will find one of these kinds of characters but not the other. That is, Character Style and Character Appearance are the same. Is it possible to make a Find expression to find a particular alphabet? Perhaps this is a question of Unicode #s? (Before Unicode this was easy, for me at least, since this difference always involved a difference of font.)

I ask because I have some documents of this type that have gone through various incarnations and show up in Mellel (after various manipulations) in Lucida Grande. (In producing documents now I am careful to give distinguish in some way.)

Thanks,
James
donb
Knows everything, can prove it
Posts: 326
Joined: Thu Oct 20, 2005 7:43 am

Post by donb »

I've just tried this out and think I have found the answer to your problem.

In your find expression, when one or more Greek letters are to be searched for, be sure you have the Greek flag showing in your flag menu, which tells Mellel that you want specifically letters in the Greek alphabet.

Don Broadribb
Eyal Redler
Co-founder
Posts: 695
Joined: Thu Oct 27, 2005 9:15 am

Re: Find expression--alphabets

Post by Eyal Redler »

jb wrote:Is it possible to make a Find expression to find a particular alphabet? Perhaps this is a question of Unicode #s? (Before Unicode this was easy, for me at least, since this difference always involved a difference of font.)
Yes, It is a question of unicode numbers. When you type using a proper unicode font like lucida grande, typing greek means that you're typing different characters then roman characters and those can be distinguished regardless of the font. If you just want to find greek characters then you can use a "Character Range" element and enter the appropriate start and end character codes (for greek these are U+0370 to U+03FF. You can always refer to the character palette to see where the ranges start and end.
Eyal Redler
----------------------
Co-Founder and Owner at Mellel
Facebook: http://www.facebook.com/mellelwordprocessor
YouTube: http://www.youtube.com/user/MellelRedlex
Donate: https://www.paypal.com/donate/?hosted_b ... 2LWB33YBZW
jb
Read the guide, knows everything
Posts: 51
Joined: Mon Aug 21, 2006 5:05 pm

Re: Find expression--alphabets

Post by jb »

Eyal Redler wrote:If you just want to find greek characters then you can use a "Character Range" element and enter the appropriate start and end character codes (for greek these are U+0370 to U+03FF. You can always refer to the character palette to see where the ranges start and end.
This is very helpful. Many thanks.
I can now find individual characters without a hitch.

But finding a word--or passage--seems a bit more complicated.

As it happens, Greek (ancient) requires two sets of Unicode codes (one is called 'extended'--it has the diacritics). These two sets are U+0370 to U+03FF AND U+1F00 to U+1FFE. Since I want to find words, I need to build a Find expression with Word Boundary at either end (or whitespace? perhaps whitespace counts as word boundary?). But of course I need to allow for a word to be formed of any combination of these two Unicode sets. Only from one, from both, one before the other, etc.
This gets to be pretty confusing with plenty of ORs and brackets, etc.
I made one that looked promising, but it found only individual characters, not words. I think this may have happened because I had a string of items connected by OR; every word is just a collection of characters and that's what the find expression found first. Perhaps there's a way to do it right?

Can anyone tell me how to make such an expression?

What I would really like to be able to find is any passage--from one word to a paragraph or two--composed of either or both of these Unicode character ranges. Such passages would be surrounded by text in Roman alphabet.

Thanks again
James
Mart°n
Knows everything, can prove it
Posts: 672
Joined: Fri Oct 21, 2005 2:09 am
Location: Germany

Post by Mart°n »

Wouldn’t a character set from U+0370 to U+1FFE work? This set contains all your needed Greek characters (among others) but doesn’t contain the Roman characters (which are from U+0000 to U+0240 if you use a extended set)
jb
Read the guide, knows everything
Posts: 51
Joined: Mon Aug 21, 2006 5:05 pm

Post by jb »

Mart°n wrote:Wouldn’t a character set from U+0370 to U+1FFE work? This set contains all your needed Greek characters (among others) but doesn’t contain the Roman characters (which are from U+0000 to U+0240 if you use a extended set)
Yes this does find any character, but it doesn't find words, etc.

What I'm after is a way to find--and at one fell swoop selecting--all passages containing this alphabet. Of course I can use Find w/ such a character range to find where in the document such passages are, but then I'm left selecting them manually, one at a time. So it's not finding such passages per se that eludes me; rather it's making a Find expression that will selct the entire passage. (In part I'm trying to learn how F/R works!)

Thanks for your help.

James
joewiz
Knows everything, can prove it
Posts: 199
Joined: Sun Oct 23, 2005 9:42 pm

Post by joewiz »

jb wrote:What I'm after is a way to find--and at one fell swoop selecting--all passages containing this alphabet. Of course I can use Find w/ such a character range to find where in the document such passages are, but then I'm left selecting them manually, one at a time. So it's not finding such passages per se that eludes me; rather it's making a Find expression that will selct the entire passage. (In part I'm trying to learn how F/R works!)
Once you've found and selected a passage, what do you want to do with it? If you just wanted to bold all Greek letters, there's not really a need to find passages -- I would simply set find to find each character and replace it with a bold version. But if you want, for example, to add a line break at the beginning and end of each Greek passage, you would need to find each passage as a whole.

In other words, how you set up the find expression depends on what you intend to replace it with. Knowing that would probably help the folks here help you design the right find expression.

As a hint, I think you should read the section in the Mellel Guide's Find and Replace section closely on the definitions of 'greedy' and 'repetition'.
jb
Read the guide, knows everything
Posts: 51
Joined: Mon Aug 21, 2006 5:05 pm

Post by jb »

joewiz wrote: As a hint, I think you should read the section in the Mellel Guide's Find and Replace section closely on the definitions of 'greedy' and 'repetition'.
Thanks for the suggestion. Greedy helps a lot. I'm getting closer. I'll do my homework and see if I can figure it out from here. (I think I discovered that white space is not in the unicode range I used. Adding that gets me half-way.)

Thanks again,
James
Post Reply