WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
This repository was archived by the owner on Oct 6, 2022. It is now read-only.

Conversation

@bstrand
Copy link

@bstrand bstrand commented Apr 25, 2022

Fix for #84.

2 changes in creation of search index:

  1. When cleaning the glyph name, instead of replacing the literal string ' a ', use a regex to only replace ' a ' when it's not preceded by 'letter'.
    This ensures that 'a' is added to the index as a keyword for a glyph when its name contains "letter a":
    e.g., latin small letter a with grave
    …while still excluding 'a' as a keyword for glyph names that use 'a' as an indefinite article:
    e.g., x in a rectangle box
    The result is then consistent with other letter glyphs.

  2. When replacing ' a ' or ' an ', replace with a single space instead of blank to preserve the boundary between the remaining words.
    Thus x in a rectangle box will be added to the index as x in rectangle box instead of x inrectangle box, and this glyph can then be found by searching for 'rectangle'.

Note this change does not affect handling of glyphs with "linear a" in their name, which while not an indefinite article usage, seems to be the desired behavior.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant