Re: How to check variables for uniqueness ?



Oliver Wong wrote:
"John Ersatznom" <j.ersatz@xxxxxxxxxxxxxxx> wrote in message news:en3as3$p8d$2@xxxxxxxxxxx

Oliver Wong wrote:

assert locale is German; //pseudcode
assert "BEISSEN".toLowerCase().equals("beissen");
assert "BEISSEN".toLowerCase().equals("beißen");

Yeah, and assert "Color".toLowerCase().equals("Colour".toLowerCase()).


{
String originalA = "color";
a = originalA; // "color"
a = a.toUppercase(); // "COLOR"
a = a.toLowercase(); // "color"
assert a.equals(originalA);
}

I don't see "colour" (with a U) in there anywhere, Oliver.

You weren't intended to.

Then you're missing the point entirely. "COLOR" and "colour" differ only by capitalization while "beissen" and "beißen" differ by spelling in a manner similar to "color" vs. "colour". Alternate spellings of the same word can't in general be idenfitied as identical by a computer -- not without a trip through a spellchecking dictionary or the like, anyway. I think you may be expecting too much of Java's humble string classes. Perhaps Collator is smart enough for you?
.



Relevant Pages

  • Re: Cheese On Toast
    ... spelling* but differ in meaning, such as bank and bank (place ...
    (rec.humor)
  • Re: If FHM were around when Dr Who was on our TV screens
    ... >>>Best not, until you've sorted out the spelling, capitalization, font size ... Prev by Date: ...
    (uk.media.tv.sf.drwho)
  • Re: If FHM were around when Dr Who was on our TV screens
    ... >Best not, until you've sorted out the spelling, capitalization, font size & ... Member - Liberal International ...
    (uk.media.tv.sf.drwho)
  • Re: Seperation of Chuch and State
    ... >>> We should worry about correcting the president's capitalization ... >>> and punctuation first. ... We'll deal with spelling later. ... >> Pootie, if you have nothing relevant to add to this discussion, ...
    (rec.sport.pro-wrestling)
  • Re: Ancient Torah Discovered
    ... Shouldn't it then be an exact ... The three communities disjoint enough to have not compared and ... -- do have differences in spelling. ... but there are all of NINE letters that differ. ...
    (soc.culture.jewish.moderated)