Exemple #1
0
 private void OnClearContent(object sender, RoutedEventArgs e)
 {
     textInput.Text = "";
     SegTagItems.Clear();
     listBaseTokens.Clear();
     listMixTokens.Clear();
     resTencentSeg  = null;
     resBosonSegTag = null;
 }
Exemple #2
0
        private async Task OnSegTag()
        {
            resBosonSegTag = await BosonAIHelper.WordSegAndTag(textInput.Text.Trim());

            if (resBosonSegTag != null && resBosonSegTag.tag.Count > 0)
            {
                for (int i = 0; i <= resBosonSegTag.tag.Count - 1; i++)
                {
                    NLPWord nlp = new NLPWord
                    {
                        word    = resBosonSegTag.word[i],
                        width   = resBosonSegTag.word[i].Length * 20,
                        bgcolor = PosTagHelper.GetPosColor_Boson(resBosonSegTag.tag[i])
                    };
                    SegTagItems.Add(nlp);
                }
            }
        }