I need a string pattern that matches words lying between a lower word lW and an upper word uW. Ordering is the standard lexical (alphabetic) order.
The following pattern does the job, but takes a long time if a large word base is used. Actually, I need the pattern for DictionaryLookup in natural languages.
Block[{lW = "Zyniker", uW = "Zypresse"},
StringMatchQ[{"zylindrisch", "zynisch", "Zypern", "Zyste"},
w__ /; AlphabeticOrder[lW, w, IgnoreCase -> True] == 1 &&
AlphabeticOrder[w, uW, IgnoreCase -> True] == 1]
]
{False, True, True, False}
Is there some more elegant and fast pattern?