예제 #1
0
        private double GetWordProbability(string word)
        {
            if ((word.Length == 1) && !StringsHelper.IsLettersOrDash(word[0]))
            {
                return(1);
            }

            return(_Model.TryGetProbability(word, out var prob) ? prob : 0);
        }
예제 #2
0
        unsafe private double GetWordProbability(ref NativeOffset no)
        {
            if ((no.Length == 1) && !StringsHelper.IsLettersOrDash(no.BasePtr[no.StartIndex]))
            {
                return(1);
            }

            return(_Model.TryGetProbability(ref no, out var prob) ? prob : 0);
        }