by Rendello · 2y ago · 0 comments
Most Inuit in Canada speak Inuktitut, which is a language with long words and two different writing systems: the latin alphabet, and syllabics. Syllabics are specially adapted for Inuktitut and well-loved by the Inuit, but unfortunately can be a pain to input on a computer, so often times the more cumbersome latin alphabet is used in casual writing.
Tom Scott has an awesome video about how syllabics work[1], but breifly, the shape of the character determined its inital consonant spund, and the rotation determines its vowel sound. So ᐱ = pi, ᐳ = pu, ᐸ = pa, ᑎ = ti, ᑐ = tu, ᑕ = ta, etc. The word "Inuktitut" becomes ᐃᓄᒃᑎᑐᑦ in syllabics.
Transliterating between the two is fairly simple, but there are edge-cases around dialects and whatnot. The more interesting problem from a technical perspective is having a web extension that can detect Inuktitut on a web page (in wither writing system), and transliterate that into whatever writing system the user desires, whilst never accidentally transliterating the other text on the page ("inhabitants" could be picked up and transliterated as "ᐃᓐᕼᐊᖯᐃᑕᓐᑦᔅ", for example, even though that makes no sense).
The project is mostly using Rust via WebAssembly, which has been a lot of fun to work with and has let me do some awesome things, like avoiding heap allocation and using compile-time hashmaps to do conversions on the text. The build system has to do a lot and I eventually settled on python. Right now I'm trying to wrangle JS and the DOM (there's a lot of edge cases to deal with), and that's been difficult as it's not my wheelhouse.
Inuktitut is very cool. I'm not a speaker so I'm relying heavily on research, but I've always loved making tools for syllabics and working with text generally.
I made a few syllabics converters for Ojibwe when I was younger, but Ojibwe and Cree are harder to build converters from than Inuktitut because they have a lenis-fortis distinction in the latin script but not syllabics, so the word "anishinaabe" can be converted unambiguously to ᐊᓂᔑᓈᐯᒃ, but trying to convert the other way could render any one of anishinaabe, ani*zh*inaabe, anishinaa*pe*, or ani*zh*inaa*pe*. I don't think it could be done accurately without some sort of machine learning. There's also a lot more complexities surrounding how different dialects are encoded. In the end, Inuktitut was simpler to work with and has a lot more everyday speakers and text to work with, especially because the Canadian territory of Nunavut publishes its government documents and websites in Inuktitut too.
There's a lot to cover but I think the technical challenges might be interesting to the Hacker News crowd, I may make a series of videos about it someday!