Supporting Nias language on Android smartphones and PCs

Nias traditional wear (Photo: Private archive)


The pain and beyond

If you have ever typed a lot in Nias language, you must have felt the pain I had had with it. Whether you type on a smartphone screen or on a PC keyboard, the keyboard does not feature the characters ö and ŵ which are frequently found in Nias vocabulary.

The existing solution is cumbersome to carry out. On a smartphone keyboard you would get those characters by long-pressing the letter o and w to get letter ö and ŵ respectively. On a PC people usually use the combination shortcuts (like Alt+1945 or whatever).

And if you have ever typed long texts in Nias language, you must have known that both solutions are not convenient at all and they basically slow down the typing flow.

But that's only one side of the story. Looking further it seems that Nias language is virtually absent from the Internet and social media. People with Nias mother tongue and others with Nias language skills don't communicate in that language on social media.

Therefore I thought a Nias keyboard with automatic word correction and next word prediction would encourage those people to start using Nias. Such a keyboard would not force them to change app or platform. They can continue using their favourite app such as WhatsApp, but now they have the possibility to write and chat in Nias language with other Nias speaking friends.

Regardless whether they want to chat through Facebook Messenger or Telegram or other social media app, they can continue to do so just by toggling the keyboard between the languages they happen to type in.

So this is a solution to a problem, but at the same time it goes beyond that. It is a tool to encourage people to write and chat in Nias language.

Let be honest, young Niassan talk less and less in Nias and more and more in Indonesian. The available technology encourages them to use Indonesian. My hope is if people chat more in Nias language, they would create new Nias expressions to enhance the language and make it usable in the Internet age.

And if that happened, Nias keyboard would have contributed to saving Nias language from the extinction :-) So this is the end goal!

Isn't there any app out there supporting Nias language?

Yes. One of them is the well-known SwiftKey. It surprisingly supports Nias language. However it doesn't offer the required keyboard layout. Even more the automatic correction and next word prediction are far from perfect. You would know what I mean once you compare it with Nias Keyboard.

Surely I would be happy to improve SwiftKey's support for Nias language if I had access to it. But I don't so I decided to use AnySoftKeyboard (ASK) app instead. Not only ASK is open-source. You can also improve it or add new language module at your own pace. Even more, you can add the language module and publish it yourself on Google Play Store without restriction from the main app owner!

So the solution I'm offering here is a language module to AnySoftKeyboard. You have to install that app too in order to be able to enjoy Nias keyboard with its built in auto-correct and next word prediction feature.

Nias Keyboard in Action

How did I get there

Luckily I found in my archive the New Testament translation by Fr. Hadrian Hess and Yulius Lahagu. They once worked for the Liturgy Commission of the Diocese of Sibolga and tasked with the new Nias translation of the New Testament. It contains more than 11,000 unique words, so it can become the base for the Nias spelling dictionary.

Unfortunately the texts are full of misspelled words and in addition the chaotic formatting makes it difficult to convert in a simple text format. It took me months (and still on-going) to proof-read it, remove formatting issues and in particular to remove all the hard hyphen plaguing most of the words. The typewriter had inserted hard hyphen instead of soft hyphen.

When I mentioned about this to Fr. Hadrian in an email yesterday (19 Jan 2019), he didn't comment on it in his reply. Instead he said he would be happy to see the texts used to make this project possible.

Obviously this text alone would not be enough. In order to rank the word frequency needed for next word prediction function the more texts the better.

Unfortunately there are hardly any publicly accessible texts in Nias language on the Internet.

However after doing some research in Internet I stumbled on Nias translation of the New Testament published by jw.org. I was impressed by how good the translation was. So I decided to use the words from the texts to be part of the word list I was building. In addition I web scrapped also the magazines (2018: 2nd and 3rd issue and 2019: 1st and 2nd issue) and one booklet called Lala Ena'ö Lö Tebulö I'omasi'ö Ita Lowalangi.

In short the base texts for Nias Keyboard's spelling dictionary are the Nias translation of the New Testament by Fr. Hadrian Hess and Yulius Lahagu. And to enhance the word prediction function I also add words scrapped from jw.org website.

The technical background for this is, the keyboard app requires a list of words in xml format with frequency rate in it. For example the word lowalangi has frequency rate of 138. The more texts used as base for the calculation the more accurate the next word suggestion made by the keyboard while typing.

To be clear at this stage: although the auto-correct and next word suggestion feature is quite usable, obviously its quality is limited by the kind of texts used for creating the dictionary. More content rich texts would be necessary to improved the quality. Who knows, ASK would feature user's submission of contents in the future.

What are the plans?

As I expect this will be a long journey I have broken down the plan in small steps. The target is to provide Nias Keyboard and Nias spelling on Android smartphones and on PCs (to be used with LibreOffice Writer).

The steps are following:

1. Scrap the websites (done!)

I scrapped the websites mentioned above and use the collected words to calculate the word frequency. With the combine texts (Fr. Hadrian's texts plus jw.org's texts) I could calculate that for example the word sökhi the frequency rate of 41 has!

2. Proof-read and improve Fr. Hadrian's texts (done!)

Actually only partially done. I managed to create the word list from the texts using some scripts (unique words stripped of punctuation marks, numbers and foreign words) and correct the misspellings. However I haven't finished proof-reading and reformatting the original texts itself so it is not ready to be included as texts in the app compilation process.

3. Create the Nias language module for AnySoftKeyboard with Nias keyboard layout (done!)

The beta version of the app is ready to be used and tested. The instruction how to install it will be written in a separate post (Click here once it's ready). I would be grateful for any feedback.

4. Write some simple Nias grammar for Hunspell compilation

I realised that I can't simply compile the spelling dictionary in hunspell for use on PC (LibreOffice Writer). I would need to create aff files for correct spelling. But the wide available spelling for English doesn't apply for Nias language. So I would need a simple Nias grammar to accomplish this. But I can only start looking at it once I finished working on the base texts (see no.2 above)

5. Create the spelling dictionary for LibreOffice Writer

As I am new to this I would need to familiarise myself with the hunspell etc programming. Surely this would take some time.

6. Finding a way to improve the Nias word database and the next word prediction accuracy rating

This is still far ahead. And by the way this would only happen, if Nias speaking people write more and publish more on the Internet. So this requires another project, advocacy campaign, another social media app, etc.

Enough with the story. I hope you like to give the Nias Keyboard a try. Watch this space for the instruction to install the Nias Keyboard on Android smartphone.

There is already an instruction in Indonesian. Click here to read: Instalasi keyboard Nias di smartphone Android.