sspanak / tt9

A T9 keyboard for Android devices with a hardware keypad.
Apache License 2.0
252 stars 43 forks source link

Possible Emoji Input Option #573

Open spiralingtides opened 4 months ago

spiralingtides commented 4 months ago

Instead of having a bunch of preselected emoji, one option is to import a map of words to corresponding emoji. I found this one: https://github.com/ikatyang/emoji-cheat-sheet/tree/master, but maybe there is a better one somewhere else? I'll keep looking. Have the inputs 1,1,{word}, call the corresponding emoji from the imported file as if it's an actual word, but instead of the word showing it's the corresponding emojis showing.

I know you've said emoji isn't a major concern for you, but this solution uses the framework you already have. If this solution is more complicated than I think it is please go ahead and resolve the issue. It was just a stray thought I had at work.

spiralingtides commented 4 months ago

Further clarification:

This would only be for predictive mode. Pressing 1,1 would still pull up the default emoji list, and further presses of 1 would continue to cycle through the emoji list as normal. Only by pressing other characters would the user search the other emojis.

By "import" I don't mean on the user's end. This would be something like a JSON that is imported at compile. I'd be willing to help make this list in whatever format is best for you.

The important thing is the feature to "type" emoji.

sspanak commented 4 months ago

What you are suggesting is potentially possible by creating an "emoji language". However, I don't have "the framework", right now.

In 12-key keyboards, you never type words, but only numbers. Then the numbers are converted to all possible valid words and displayed as suggestions. In other words, it is not possible to type 1-1-word the way you imagine it. The emoji language would require double conversion, like this: 1176459 -> :smile: -> :smile:.

The double conversion is also the way of adding support for Chinese, Japanese, Korean, Hindi, Armenian and other languages where one character corresponds to a Latin "word". See, it doesn't matter if the end result is a smiley face or a glyph. For this reason, I do intend to implement it sooner or later, but I still haven't figured out how to do it. Is it better to do the intermediate step at build time or at run time? What is the best way to store the word/emoji list in a file? I don't know yet.

Once this is done, it would be possible to "load" the emojis, as you suggested. Alternatively, the emojis could be included in the existing language dictionaries, but I am not sure how easy would it be to support both the single and the double conversion methods.

In the end, I don't feel much like spending time on this feature. I will likely add support syllable-based languages, but I'll let someone else search for and add the emoji "words".

spiralingtides commented 4 months ago

Seems I misunderstood how it worked. Thanks for the explanation.

So if I understand correctly, currently I can not build a custom language pack for "Emoji (English)" because it is not setup to be able to map numbers directly to glyphs?

sspanak commented 4 months ago

Correct, it is not possible to map glyphs to numbers at the moment.

spiralingtides commented 3 months ago

Understood. If you decide to add this at any point and want assistance mapping words to emoji I am willing to help in whatever way I can.