Ejemplo n.º 1
0
        public MultiMapSet <string, string> GetTagsWithDocuments(HashSet <string> documents)
        {
            HashSet <string> relevant_tags = new HashSet <string>();

            foreach (string document in documents)
            {
                relevant_tags.UnionWith(ai_documents_with_tags.Get(document));
            }

            MultiMapSet <string, string> results = new MultiMapSet <string, string>();

            foreach (string relevant_tag in relevant_tags)
            {
                foreach (string relevant_document in ai_tags_with_documents.Get(relevant_tag))
                {
                    if (documents.Contains(relevant_document))
                    {
                        results.Add(relevant_tag, relevant_document);
                    }
                }
            }

            return(results);
        }
Ejemplo n.º 2
0
 public void Associate(string tag, string document_fingerprint)
 {
     ai_tags_with_documents.Add(tag, document_fingerprint);
     ai_documents_with_tags.Add(document_fingerprint, tag);
 }