/// What a search for a meaning matches in [gloss], lower case: the gloss /// without its remarks in brackets, and without a leading "to" or article /// too (`to eat` gives `to eat` and `eat`; `the sun (in the sky)` gives /// `the sun` and `sun`). Empty for a gloss of remarks only. List glossKeys(String gloss) { final plain = gloss .toLowerCase() .replaceAll(RegExp(r'\([^)]*\)'), ' ') .replaceAll(RegExp(r'\s+'), ' ') .trim(); if (plain.isEmpty) { return const []; } final bare = plain.replaceFirst(RegExp('^(to|a|an|the) '), ''); return {plain, bare}.toList(); }