Exemple #1
0
        public static List <string> JiebaWords2StringList(ref JiebaWords words)
        {
            var ret = new List <string>();

            for (int i = 0; i < words.Count; ++i)
            {
                var wordPtrEntryInArray = IntPtr.Add(words.Words, IntPtr.Size * i);
                var wordPtr             = Marshal.PtrToStructure <IntPtr>(wordPtrEntryInArray);
                var word = Marshal.PtrToStringUTF8(wordPtr);
                ret.Add(word);
            }

            return(ret);
        }
Exemple #2
0
 public static extern uint jieba_cut_all_full(IntPtr ctx, [MarshalAs(UnmanagedType.LPUTF8Str)] string sentence, uint len, ref JiebaWords words);
Exemple #3
0
 public static extern uint jieba_cut_for_search_full(IntPtr ctx, [MarshalAs(UnmanagedType.LPUTF8Str)] string sentence, uint len, ref JiebaWords words, bool hmm = true);
Exemple #4
0
 public static extern void jieba_words_free(ref JiebaWords w);