Exemplo n.º 1
0
        protected double GetTermFreq(string doc1, string doc2, int type, string doc, string term)
        {
            double freq = 0;

            if (TermFWByDoc.ContainsKey(type, doc, term))
            {
                freq = TermFWByDoc[type, doc, term].Freq;/// (double)(TermsByDoc[0][doc1].Length + TermsByDoc[1][doc2].Length);
            }
            return(freq);
        }
Exemplo n.º 2
0
        protected void AddTerm(int docType, string doc, string term)
        {
            if (!TermFWByGlobal.ContainsKey(term))
            {
                TermFWByGlobal.Add(term, new TermFW(term));
            }
            if (!TermFWByType.ContainsKey(docType, term))
            {
                TermFWByType[docType].Add(term, new TermFW(term));
            }
            if (!TermFWByDoc.ContainsKey(docType, doc, term))
            {
                TermFWByDoc[docType][doc].Add(term, new TermFW(term));
            }

            TermFWByGlobal[term].Freq            += 1;
            TermFWByType[docType][term].Freq     += 1;
            TermFWByDoc[docType][doc][term].Freq += 1;
        }