Re: [swift-users] CharacterSet vs Set

2016-10-03 Thread Gerriet M. Denkmann via swift-users
> On 3 Oct 2016, at 19:17, Jean-Denis Muys via swift-users > wrote: > > You are right: I don’t know much about asian languages. > > How would you go about counting consonants, vowels (and tone-marks?) in the > most general way? Iterate over unicodeScalars (in the most

Re: [swift-users] CharacterSet vs Set

2016-10-03 Thread Jean-Denis Muys via swift-users
You are right: I don’t know much about asian languages. How would you go about counting consonants, vowels (and tone-marks?) in the most general way? I think I would need to educate myself about those things. Any pointer welcome. JD > On 3 Oct 2016, at 12:52, Gerriet M. Denkmann

Re: [swift-users] CharacterSet vs Set

2016-10-03 Thread Gerriet M. Denkmann via swift-users
> On 3 Oct 2016, at 16:28, Jean-Denis Muys via swift-users > wrote: > > ASCII? Probably not. Latin? perhaps, though not obvious. For example French > accented letters would probably have to be handled somehow. Greek or > Cyrillic? Perhaps. Other scripts? Unlikely, but

Re: [swift-users] CharacterSet vs Set

2016-10-03 Thread Quinn "The Eskimo!" via swift-users
On 2 Oct 2016, at 19:02, Jean-Denis Muys via swift-users wrote: > The problem is, I could not find a simple way to convert from a character to > a unicodeScalar. As is often the case with string examples, it would help if you posted more about your context. With the

Re: [swift-users] CharacterSet vs Set

2016-10-02 Thread Dave Abrahams via swift-users
on Sun Oct 02 2016, Jean-Denis Muys wrote: > I was playing with CharacterSet, and I came up with: > > let vowels = CharacterSet(charactersIn: "AEIOU") Yeah, because CharacterSet is a set of UnicodeScalars, not a set of Character. That should probably get fixed somehow. I suggest filing a

[swift-users] CharacterSet vs Set

2016-10-02 Thread Jean-Denis Muys via swift-users
I was playing with CharacterSet, and I came up with: let vowels = CharacterSet(charactersIn: "AEIOU") let char: Character = "E" vowels.contains(char) That last line doesn't compile: I get "*cannot convert value of type 'Character' to expected argument type 'UnicodeScalar'*" The problem is, I