Esempio n. 1
0
        //N is the number of closest words that will be shown
        public List <Result> Distance(string[] termList, int N = 40)
        {
            List <TermOP> termOPList = new List <TermOP>();

            foreach (string term in termList)
            {
                TermOP termOP = new TermOP();
                termOP.strTerm   = term;
                termOP.operation = TermOperation.ADD;

                termOPList.Add(termOP);
            }

            return(Distance(termOPList, N));
        }
Esempio n. 2
0
        private List <TermOP> GenerateTermOP(string[] termList)
        {
            List <TermOP> termOPList = new List <TermOP>();

            foreach (string term in termList)
            {
                TermOP termOP = new TermOP();
                termOP.strTerm   = term;
                termOP.operation = TermOperation.ADD;

                termOPList.Add(termOP);
            }

            return(termOPList);
        }
Esempio n. 3
0
        public double[] ToVector(string[] termList, int N = 40)
        {
            List <TermOP> termOPList = new List <TermOP>();

            foreach (string term in termList)
            {
                TermOP termOP = new TermOP();
                termOP.strTerm   = term;
                termOP.operation = TermOperation.ADD;

                termOPList.Add(termOP);
            }

            double[] vec = GetVector(termOPList);
            return(vec);
        }