Re: Find with Nonspacing_Mark

2008-12-29 Thread Gerriet M. Denkmann


On 29 Dec 2008, at 14:46, Aki Inoue wrote:

The standard operation here is to always match characters at the  
grapheme cluster boundaries.


Since SARA U is a non-spacing mark, we don't allow partial matching.

Trying to cause partial matching, even for Thai/Indic/Hebrew/Arabic  
scripts that some of non-spacing marks are vowels, is considered a  
good UI since it's harder for users to determine the paritiel  
selection within a graphic element.


If you really need to do the partial matching, specifying  
NSLiteralSearch flag allows it.


Thanks a lot! With NSLiteralSearch everything works perfectly now.

Kind regards,

Gerriet.




On 2008/12/28, at 21:39, "Gerriet M. Denkmann"  
 wrote:




On 29 Dec 2008, at 03:02, "Gerriet M. Denkmann"  
 wrote:



I have a NSTextView which contains "บุ" that is: THAI CHARACTER  
BO

BAIMAI + THAI CHARACTER SARA U, which is a consonant, followed by a
vowel.

When I use the Find Panel to search for "บ" (using "Contains" or:
"Starts with") nothing is found.

Same in TextEdit; same with any character + Nonspacing_Mark.

When I enter "a" + COMBINING DIAERESIS and search for "ä" (LATIN  
SMALL
LETTER A WITH DIAERESIS) the character, which looks like "ä" is  
found.

Searching for "a" does not find it.
This makes some sense.

But to treat "นุ" as one letter is just plain silly and quite  
wrong.


How can I tell the Find Panel (or the NSTextView) to find my
characters, even if they are followed by some other character?

10.5.6


I tried this:
NSString *bu = @"บุ";
NSString *ba = @"บ";
NSRange ra = [ bu rangeOfString: ba ];
if ( ra.location == NSNotFound )
{
  NSLog(@"%s There is no \"%...@\" in \"%...@\"",__FUNCTION__, ba, bu );
}
else
{
  NSLog(@"%s range of \"%...@\" in \"%...@\" is %@",__FUNCTION__, ba, bu,  
NSStringFromRange(ra));

};

and got the answer:
There is no "บ" in "บุ"
which somehow boggles my mind (might be a problem of aforementioned  
mind though).


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Find with Nonspacing_Mark

2008-12-29 Thread Aki Inoue
Actually Thai vowels are not considered a diacritics and, thus, not  
ignored by the flag.


Also, note that, even though it is true we sometimes take advantage of  
ICU from our frameworks, it is an implementation detail and should not  
be considered always true.


In this particular case, we're not using ICU :-)


Aki from iPhone


On 2008/12/28, at 22:13, Ken Ferry  wrote:


Take a look at -[NSString rangeOfString:options:range:locale:].  I'm
not familiar with Thai, but NSDiacriticInsensitiveSearch seems to be
the option required to make this search work.

If you think that there's something wrong with this particular case,
you can file a bug against Cocoa, but you might also want to file one
against ICU, .  It's the ICU tables that
determine string equality in Cocoa.

-Ken

On Mon, Dec 29, 2008 at 12:39 AM, Gerriet M. Denkmann
 wrote:


On 29 Dec 2008, at 03:02, "Gerriet M. Denkmann"  


wrote:



I have a NSTextView which contains "บุ" that is: THAI CHARACTE 
R BO

BAIMAI + THAI CHARACTER SARA U, which is a consonant, followed by a
vowel.

When I use the Find Panel to search for "บ" (using "Contains" or:
"Starts with") nothing is found.

Same in TextEdit; same with any character + Nonspacing_Mark.

When I enter "a" + COMBINING DIAERESIS and search for "ä" (LATIN 
 SMALL
LETTER A WITH DIAERESIS) the character, which looks like "ä" is  
found.

Searching for "a" does not find it.
This makes some sense.

But to treat "นุ" as one letter is just plain silly and quite wr 
ong.


How can I tell the Find Panel (or the NSTextView) to find my
characters, even if they are followed by some other character?

10.5.6


I tried this:
NSString *bu = @"บุ";
NSString *ba = @"บ";
NSRange ra = [ bu rangeOfString: ba ];
if ( ra.location == NSNotFound )
{
  NSLog(@"%s There is no \"%...@\" in \"%...@\"",__FUNCTION__, ba,  
bu );

}
else
{
  NSLog(@"%s range of \"%...@\" in \"%...@\" is %@",__FUNCTION__, ba,  
bu,

NSStringFromRange(ra));
};

and got the answer:
There is no "บ" in "บุ"
which somehow boggles my mind (might be a problem of aforementioned  
mind

though).

What do I do now: write my own version of rangeOfString: ? I would  
rather

like to avoid this.


Kind regards,

Gerriet.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/kenferry%40gmail.com

This email sent to kenfe...@gmail.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/aki%40apple.com

This email sent to a...@apple.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Find with Nonspacing_Mark

2008-12-29 Thread Aki Inoue
The standard operation here is to always match characters at the  
grapheme cluster boundaries.


Since SARA U is a non-spacing mark, we don't allow partial matching.

Trying to cause partial matching, even for Thai/Indic/Hebrew/Arabic  
scripts that some of non-spacing marks are vowels, is cosidered a good  
UI since it's harder for users to determine the paritiel selection  
within a graphic element.


If you really need to do the partial matching, specifying  
NSLiteralSearch flag allows it.


Aki from iPhone


On 2008/12/28, at 21:39, "Gerriet M. Denkmann"   
wrote:




On 29 Dec 2008, at 03:02, "Gerriet M. Denkmann"  
 wrote:



I have a NSTextView which contains "บุ" that is: THAI CHARACTER 
 BO

BAIMAI + THAI CHARACTER SARA U, which is a consonant, followed by a
vowel.

When I use the Find Panel to search for "บ" (using "Contains" or:
"Starts with") nothing is found.

Same in TextEdit; same with any character + Nonspacing_Mark.

When I enter "a" + COMBINING DIAERESIS and search for "ä" (LATIN S 
MALL
LETTER A WITH DIAERESIS) the character, which looks like "ä" is fo 
und.

Searching for "a" does not find it.
This makes some sense.

But to treat "นุ" as one letter is just plain silly and quite wro 
ng.


How can I tell the Find Panel (or the NSTextView) to find my
characters, even if they are followed by some other character?

10.5.6


I tried this:
NSString *bu = @"บุ";
NSString *ba = @"บ";
NSRange ra = [ bu rangeOfString: ba ];
if ( ra.location == NSNotFound )
{
   NSLog(@"%s There is no \"%...@\" in \"%...@\"",__FUNCTION__, ba, bu );
}
else
{
   NSLog(@"%s range of \"%...@\" in \"%...@\" is %@",__FUNCTION__, ba, bu,  
NSStringFromRange(ra));

};

and got the answer:
There is no "บ" in "บุ"
which somehow boggles my mind (might be a problem of aforementioned  
mind though).


What do I do now: write my own version of rangeOfString: ? I would  
rather like to avoid this.



Kind regards,

Gerriet.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/aki%40apple.com

This email sent to a...@apple.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Find with Nonspacing_Mark

2008-12-28 Thread Ken Ferry
Take a look at -[NSString rangeOfString:options:range:locale:].  I'm
not familiar with Thai, but NSDiacriticInsensitiveSearch seems to be
the option required to make this search work.

If you think that there's something wrong with this particular case,
you can file a bug against Cocoa, but you might also want to file one
against ICU, .  It's the ICU tables that
determine string equality in Cocoa.

-Ken

On Mon, Dec 29, 2008 at 12:39 AM, Gerriet M. Denkmann
 wrote:
>
> On 29 Dec 2008, at 03:02, "Gerriet M. Denkmann" 
> wrote:
>>
>>
>> I have a NSTextView which contains "บุ" that is: THAI CHARACTER BO
>> BAIMAI + THAI CHARACTER SARA U, which is a consonant, followed by a
>> vowel.
>>
>> When I use the Find Panel to search for "บ" (using "Contains" or:
>> "Starts with") nothing is found.
>>
>> Same in TextEdit; same with any character + Nonspacing_Mark.
>>
>> When I enter "a" + COMBINING DIAERESIS and search for "ä" (LATIN SMALL
>> LETTER A WITH DIAERESIS) the character, which looks like "ä" is found.
>> Searching for "a" does not find it.
>> This makes some sense.
>>
>> But to treat "นุ" as one letter is just plain silly and quite wrong.
>>
>> How can I tell the Find Panel (or the NSTextView) to find my
>> characters, even if they are followed by some other character?
>>
>> 10.5.6
>
> I tried this:
> NSString *bu = @"บุ";
> NSString *ba = @"บ";
> NSRange ra = [ bu rangeOfString: ba ];
> if ( ra.location == NSNotFound )
> {
>NSLog(@"%s There is no \"%...@\" in \"%...@\"",__FUNCTION__, ba, bu );
> }
> else
> {
>NSLog(@"%s range of \"%...@\" in \"%...@\" is %@",__FUNCTION__, ba, bu,
> NSStringFromRange(ra));
> };
>
> and got the answer:
>  There is no "บ" in "บุ"
> which somehow boggles my mind (might be a problem of aforementioned mind
> though).
>
> What do I do now: write my own version of rangeOfString: ? I would rather
> like to avoid this.
>
>
> Kind regards,
>
> Gerriet.
>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/kenferry%40gmail.com
>
> This email sent to kenfe...@gmail.com
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Find with Nonspacing_Mark

2008-12-28 Thread Gerriet M. Denkmann


On 29 Dec 2008, at 03:02, "Gerriet M. Denkmann"   
wrote:



I have a NSTextView which contains "บุ" that is: THAI CHARACTER BO
BAIMAI + THAI CHARACTER SARA U, which is a consonant, followed by a
vowel.

When I use the Find Panel to search for "บ" (using "Contains" or:
"Starts with") nothing is found.

Same in TextEdit; same with any character + Nonspacing_Mark.

When I enter "a" + COMBINING DIAERESIS and search for "ä" (LATIN  
SMALL
LETTER A WITH DIAERESIS) the character, which looks like "ä" is  
found.

Searching for "a" does not find it.
This makes some sense.

But to treat "นุ" as one letter is just plain silly and quite  
wrong.


How can I tell the Find Panel (or the NSTextView) to find my
characters, even if they are followed by some other character?

10.5.6


I tried this:
NSString *bu = @"บุ";
NSString *ba = @"บ";
NSRange ra = [ bu rangeOfString: ba ];
if ( ra.location == NSNotFound )
{
NSLog(@"%s There is no \"%...@\" in \"%...@\"",__FUNCTION__, ba, bu );
}
else
{
	NSLog(@"%s range of \"%...@\" in \"%...@\" is %@",__FUNCTION__, ba, bu,  
NSStringFromRange(ra));

};

and got the answer:
 There is no "บ" in "บุ"
which somehow boggles my mind (might be a problem of aforementioned  
mind though).


What do I do now: write my own version of rangeOfString: ? I would  
rather like to avoid this.



Kind regards,

Gerriet.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Find with Nonspacing_Mark

2008-12-28 Thread Gerriet M. Denkmann


I have a NSTextView which contains "บุ" that is: THAI CHARACTER BO  
BAIMAI + THAI CHARACTER SARA U, which is a consonant, followed by a  
vowel.


When I use the Find Panel to search for "บ" (using "Contains" or:  
"Starts with") nothing is found.


Same in TextEdit; same with any character + Nonspacing_Mark.

When I enter "a" + COMBINING DIAERESIS and search for "ä" (LATIN SMALL  
LETTER A WITH DIAERESIS) the character, which looks like "ä" is found.  
Searching for "a" does not find it.

This makes some sense.

But to treat "นุ" as one letter is just plain silly and quite wrong.

How can I tell the Find Panel (or the NSTextView) to find my  
characters, even if they are followed by some other character?


10.5.6


Kind regards,

Gerriet.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com