示例#1
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);
                }
            }
        }
示例#2
0
        private async void OnMixTokens(object sender, RoutedEventArgs e)
        {
            animationView.Visibility = Visibility.Visible;
            ResetAll();
            await GetTencentAIResponse();

            listMixTokens.ForEach((x) =>
            {
                NLPWord nlp = new NLPWord
                {
                    word    = x.word,
                    width   = x.length * 20,
                    bgcolor = PosTagHelper.GetPosColor_Tencent(x.pos_code.ToString())
                };
                SegTagItems.Add(nlp);
            });
            animationView.Visibility = Visibility.Collapsed;
        }