Open Windowsfreak opened 11 months ago
Maybe text.split(/([ \n\t]+)/)
needs to be extended to capture all non-English characters, so that compound-words are correctly translated (and not the first half).
cf. https://github.com/paralogical/glish/blob/main/ui/src/App.tsx#L24
yeah, we probably need to be splitting on hyphen there, good catch.
There's a bug in your application. If you enter a word such as
multi-directional
, the second word doesn't get translated at all, compared to when it was separated with spaces. I suggest you'd use a tokeniser to pass on non-word characters unchanged and capture groups of word characters, instead of whatever you did to capture only the first half of a hyphenised compound word ;)