voku / portable-ascii

🔡 Portable ASCII library - performance optimized (ascii) string functions for PHP.
MIT License
522 stars 32 forks source link

Is Greek to ASCII correct? #4

Open voku opened 5 years ago

voku commented 5 years ago

Example: Is this correct?

"Ελληνικό αλφάβητο" -> "Ellhniko alfabhto"


Can a native speaker, please check the character-replacement, thanks.

https://github.com/voku/portable-ascii/blob/master/src/voku/helper/data/ascii_by_languages.php#L4

gmponos commented 5 years ago

OK.. need to understand what is the purpose of this lib.

For instance convert Greek characters to what we Greeks call Greeklish (writing Greek using English characters in order to avoid language switching from keyboard)

Or you want to convert Greek characters to something meaningful? Something that could be used to Road Signs for instance.

Example let's use the word Αθήνα meaning Athens

according to your lib it will be

A8ina -> It makes sense when you type on a chat room. We Greeks replaced on chat rooms θ with 8. Visually there are kinda similar. But as you can understand this can be used only to chat rooms etc

Instead on a Road Sign you will in Greece you will see Αθήνα as Athina

Same goes for other letters Ξ which your library replaces with 3.. Let me know the answer and I will try to contribute back.

voku commented 5 years ago

Maybe we can add both ways, because you can choose one and so it's more useful for different situations.

For example there is a similar issue for "ru" (https://github.com/voku/portable-ascii/issues/3#issuecomment-531763644). Maybe we can also add e.g. "el_greeklish". Only a idea, what do you think?

voku commented 5 years ago

@gmponos I have separated "greek" and "greeklish", can you please re-review the changes, thanks.

https://github.com/voku/portable-ascii/commit/98cb9b3eb6f86054dd61994402d54efcdaa60f2e#diff-07a0c79489ea27ae5e059a433ba83a34R5

sebdesign commented 3 years ago

@voku as a native speaker I think the greeklish mappings are not very accurate.

For example 'π' => 'n' and 'Π' => 'N' are wrong, I've never seen anyone using N/n as a replacement for Π/π (P/p), even in prehistoric chatrooms in the 90s. It should be 'π' => 'p' and 'Π' => 'P'.

Also:

voku commented 3 years ago

@sebdesign Thanks for the update. Can you please take a look at this fix: https://github.com/voku/portable-ascii/commit/abfac74fac216982f1c59f2a3c62a90df3f8d72a

sebdesign commented 3 years ago

@voku I'll take a look later tonight!