MinusculeMatcher (MinusculeMatcher delegate) { String pattern = delegate.getPattern(); if (pattern.startsWith("*")) { pattern = pattern.substring(1); } if (pattern.isEmpty()) return delegate; for (int i = 0; i < pattern.length(); i++) { char c = pattern.charAt(i); // Pinyin initials are always lowercase English letters and never include i, u, or v if (c < 'a' || c > 'z' || c == 'i' || c == 'u' || c == 'v') return delegate; } return new MatcherWithFallback(delegate, new PinyinMatcher(pattern)); }