Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust port? #168

Open
asdofindia opened this issue Feb 9, 2021 · 6 comments
Open

Rust port? #168

asdofindia opened this issue Feb 9, 2021 · 6 comments

Comments

@asdofindia
Copy link
Contributor

Is a Rust port of varnam a bad idea? If someone's porting varnam into a different language, what should they do differently?

@joicemjoseph
Copy link

We(Subin, Kailash and me) had a plan to port Varnam to Go. Also had a conversation with Navaneeth on the architecture as well.
AFAIK, core of this project is a lexer(I guess) written in Ruby. It leverages advantages of that language. porting the rule engine will be the a bottleneck I guess.
It will be great to port to modern languages, either go or rust.

@subins2000
Copy link
Member

If we're going to do a rewrite, some improvements I suggest :

  • No need of a pattern => word DB (learnings file). Instead, just need a word dictionary.
  • Add more patterns to VST (Varnam Symbol Table). Prioritized letters n => ന, ണ. Capitalized N will always give . So pani will give suggestions in priority : പനി, പണി. Currently if only the learnings DB has pani assigned to both words will give the different outputs.
  • When an input say pani is given to varnam, it should tokenize to പനി and പണി using just VST, and then look up the word dictionary to find words starting with പനി and പണി and give additional suggestions.
  • For english words like "Cricket", the tokenization will give bad results, in such cases we can maybe use a pattern => word DB like the current learnings DB.

@subins2000
Copy link
Member

Also, can dynamic libraries be made in Go & Rust ? Can it then be compiled in Android to be used in Indic Keyboard ? A straight replacement ? Is there a JNI equivalent for Go/Rust libraries in Java ? If not, things will be more difficult.

@asdofindia
Copy link
Contributor Author

There's https://github.com/mozilla/rust-android-gradle for rust in android

@subins2000
Copy link
Member

Varnam desktop app, varnamd API server is all written in Go. If we're going to do a rewrite, golang will be the better choice for compatibility reasons and maintainability. I saw that there is JNI compatibility with go too.

I hope it will be a straight, simple replacement or others that depend on libvarnam breaks! (Desktop, Indic Keyboard, API) 😅

@asdofindia
Copy link
Contributor Author

@joicemjoseph , you're right about the lexer. https://asd.learnlearn.in/varnam-1/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants