Ejemplo n.º 1
0
        public void parseHtml(string file)
        {
            List <string> temp = new List <string>();

            StreamReader HReader = new StreamReader(file);

            foreach (var parag in HReader.ReadToEnd().Split('<'))
            {
                if (parag.StartsWith("p") || parag.StartsWith("b"))
                {
                    temp = Normalize.normalList(Tokenize.tokenList(parag));
                    foreach (var term in temp)
                    {
                        if (tokenizedHtml.ContainsKey(term))
                        {
                            if (tokenizedHtml[term].ContainsKey(file))
                            {
                                tokenizedHtml[term][file] = tokenizedHtml[term][file] + 1;
                            }
                            else
                            {
                                tokenizedHtml[term].Add(file, 1);
                            }
                        }
                        else
                        {
                            tokenizedHtml.Add(term, new Dictionary <string, int>()
                            {
                                { file, 1 }
                            });
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public Query(string q)
 {
     tokens = Normalize.normalList(Tokenize.tokenList(q));
 }