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

Transliterate non-latin strings into latin if there's no match #2395

Merged
merged 2 commits into from Oct 24, 2017

Conversation

pjrobertson
Copy link
Member

@pjrobertson pjrobertson commented Sep 19, 2017

I'm back! Although for my own selfish needs :'(

Most non-latin languages have formal romanizations from the native script to latin (e.g. 中国 -> zhongguo). This change allows you to search using latin characters for non-latin names/labels. It should apply to all latin languages that have formal romanizations.

One issue that I had with this is that when you romanize a non-latin search string (e.g. 中国) its length is changed (often increased):

中国 => length 2
zhongguo => length 8

This would cause problems when displaying the characters that matched in the string (normally done by underlining them in the SOV. To solve this problem I just opted to not show which letters matched:

screen shot 2017-09-19 at 10 05 32

Note that this change will have an affect on all users, and my suspicion is most of our users are limited to latin-character only languages. As such I'd be interested to:

a) know if this makes searching slower for people
b) if so, should it just be included as a hidden pref?

Most non-latin languages have formal romanizations from the native script to latin (e.g. 中国 -> zhongguo). This change allows you to search using latin characters for non-latin names/labels. It should apply to all latin languages that have formal romanizations
@pjrobertson
Copy link
Member Author

@pjrobertson pjrobertson commented Sep 19, 2017

To read up on what I've done here, NSHipster is always here to help: http://nshipster.com/cfstringtransform/

@skurfer
Copy link
Member

@skurfer skurfer commented Oct 13, 2017

I'm back! Although for my own selfish needs :’(

But isn’t that the source of all pull requests?

I’ll give this a look.

@pjrobertson
Copy link
Member Author

@pjrobertson pjrobertson commented Oct 22, 2017

Great, thanks! I was just jumping on here to ask if I could merge :)

@skurfer
Copy link
Member

@skurfer skurfer commented Oct 22, 2017

I’ve been using this for a while and haven’t noticed any performance problems. I’ll be merging this and some of the others for a new release soon. (Hoping to hear something on the exceptions from the updater first.)

@pjrobertson
Copy link
Member Author

@pjrobertson pjrobertson commented Oct 23, 2017

@skurfer
Copy link
Member

@skurfer skurfer commented Oct 24, 2017

We’re discussing it in #2402. There isn’t really a clean solution.

@skurfer skurfer merged commit ae396b3 into master Oct 24, 2017
2 checks passed
@skurfer skurfer deleted the pinyin_search branch Oct 24, 2017
@skurfer
Copy link
Member

@skurfer skurfer commented Oct 24, 2017

Would you mind adding this one to the release notes @pjrobertson? Not sure I would summarize it quite right.

pjrobertson added a commit that referenced this issue Oct 25, 2017
@pjrobertson
Copy link
Member Author

@pjrobertson pjrobertson commented Oct 25, 2017

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

Successfully merging this pull request may close these issues.

None yet

2 participants