internal static List <string> ScalaSeqStringConverter(scala.collection.Seq sequences)
            {
                List <string> results = new List <string>();

                for (int i = 0; i < sequences.size(); i++)
                {
                    var    scalaResult = sequences.apply(i);
                    string result      = scalaResult.toString();
                    results.Add(result);
                }

                return(results);
            }
            internal static List <T> ScalaSeqConverter <T, TScala>(scala.collection.Seq sequences, Func <TScala, T> convertFunc)
                where TScala : class
                where T : class
            {
                List <T> results = new List <T>();

                for (int i = 0; i < sequences.size(); i++)
                {
                    TScala scalaResult = sequences.apply(i) as TScala;
                    T      result      = convertFunc(scalaResult);
                    results.Add(result);
                }

                return(results);
            }
Example #3
0
        public static List <POS> ToPosListFromTokens(this scala.collection.Seq seq)
        {
            var result = new List <POS>();

            for (int i = 0; i < seq.size(); i++)
            {
                KoreanTokenizer.KoreanToken scalaResult = seq.apply(i) as KoreanTokenizer.KoreanToken;
                result.Add(new POS()
                {
                    PosTag = ((TwitterPos)scalaResult.pos().id()).ToString(),
                    Text   = scalaResult.text()
                });
            }
            return(result);
        }
Example #4
0
        public static List <POS> ToPosList(this scala.collection.Seq seq)
        {
            var result = new List <POS>();

            for (int i = 0; i < seq.size(); i++)
            {
                KoreanPhraseExtractor.KoreanPhrase scalaResult = seq.apply(i) as KoreanPhraseExtractor.KoreanPhrase;
                var    tokens = scalaResult.tokens();
                string text   = string.Empty;
                for (int j = 0; j < tokens.size(); j++)
                {
                    KoreanTokenizer.KoreanToken token = tokens.apply(j) as KoreanTokenizer.KoreanToken;
                    text += token.text();
                }

                result.Add(new POS()
                {
                    PosTag = ((TwitterPos)scalaResult.pos().id()).ToString(),
                    Text   = text
                });
            }
            return(result);
        }