Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

fix: search for letter 'A' variants #85

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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