SWLOR_NWN icon indicating copy to clipboard operation
SWLOR_NWN copied to clipboard

Feature/base recursive language translator framework

Open StealthyKraken opened this issue 1 year ago • 2 comments

This feature implements the BaseRecursiveLanguageTranslator class to support explicit translation definitions for letters, segments, words and phrases, both language specific and general, all conveniently stored in 2 CSV-files. The files also support an easy definition of whether the segment has to be at the start or end of a word, sentence, etc. to be translated as such.

This is to offer a more immersive and in-universe representation of the languages seen in Star Wars and to lower the entry barrier for anyone wishing to create such definitions in the creative process of designing an unknown language from scratch. Additionally, the general definitions allow for names and such to be added to a pool of segments, that will always be translated to themselves, unless the language has its own definition for the word, i.e. jedi generally being translated into jedi, but mandoa has the word jetii for it.

Currently, Mandoa is already using the new framework with a file of about 2000 definitions. Here, the translation algorithm has been benchmarked for 300 letter input, which will be translated in a time of 2-3 ms, the result being cached for any successive listeners to the same input, the reading of which will then take ~1ms. Furthermore, Bothese, Catharese, Cheunh, Dosh and Huttese already implement the new Framework, but their definitions do not exceed what was already there before, except the usage of the general definitions.

In addition to this, the option has been added to always show the RP language in the combat log, in parallel to whichever the listener gets translated. I have also added some more commands to the /lang line of commands to make their usage more convenient.

StealthyKraken avatar Dec 02 '22 01:12 StealthyKraken