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

Ignoring character names #19

Closed
agyild opened this issue Aug 28, 2018 · 2 comments
Closed

Ignoring character names #19

agyild opened this issue Aug 28, 2018 · 2 comments

Comments

@agyild
Copy link

agyild commented Aug 28, 2018

Hooks usually return dialog text alongside with character names which sometimes cause mistranslation. A mechanism such as a dictionary blacklist, using delimiters, semi-automatic name detection (keep a list of most encountered name-like substrings and make the user choose one) etc. would be useful. Probably more than one mechanism is needed, semi-automatic detection might be too expensive since it would require extra parsing and keeping everything in memory but it might be made togglable so the user only activates it when needed and disables it after adding string to the blacklist.

@Artikash
Copy link
Owner

Artikash commented Aug 29, 2018

Nah it's a lot simpler than that. Basically when you have a name in the text google translate will still send the translation back, but in a way that NH can't correctly parse it. To parse it correctly I basically just have to replicate this line of code in C++:
const processGoogleTranslateData = data => JSON.parse(data)[0].filter(v => v[0]).map(v => v[0]).join(" ");
but that's such a pain that I've put it off for weeks xD. Anyway, known bug, it'll be fixed somewhat soon maybe.

@Artikash
Copy link
Owner

nvm just realized a single std::wregex(L"\\[\"(.*?)\",[n\"]") is enough to usually parse it correctly. Is fixed now :)

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

2 participants