private static SplitToken[] SplitIntoConvertedKana(string input, WanaKanaOptions?options, Trie trie)
        {
            options ??= new WanaKanaOptions();
            if (trie == null)
            {
                trie = CreateRomajiToKanaMap(options);
            }

            return(TrieHelpers.ApplyTrie(input.ToLowerInvariant(), trie, options.ImeMode == ImeMode.None));
        }
Exemple #2
0
        private static SplitToken[] SplitIntoRomaji(string input, WanaKanaOptions options)
        {
            var map = KanaToRomajiMap.GetKanaToRomajiTree(options);

            if (options.CustomRomajiMapping != null)
            {
                map = map.Clone();
                map.AddRange(options.CustomRomajiMapping);
            }

            return(TrieHelpers.ApplyTrie(KanaConverters.KatakanaToHiragana(input, true), map, options.ImeMode == ImeMode.None));
        }