Ejemplo n.º 1
0
 private void btnLoad_Click(object sender, EventArgs e)
 {
     if (openFileDialog1.ShowDialog() == DialogResult.OK)
     {
         helper = new MindMapOntology(openFileDialog1.FileName);
         //MindMapConcept c1 = helper.Concepts["READ"];
         //MindMapConcept c2 = helper.Concepts["GOLF"];
         //DistanceInfo info = MindMapConcept.Distance(c1, c2);
         //MessageBox.Show(info.Distance.ToString());
         foreach (string conceptName in helper.Concepts.Keys)
         {
             this.lboxChildren.Items.Add(conceptName);
         }
         MyWordInfo word = new MyWordInfo("accomplishment", PartsOfSpeech.Noun);
         word.Sense = 1;
         MindMapConcept concept = MindMapMapper.GetConcept(word, helper);
         if (concept == null)
         {
             MessageBox.Show("Test");
         }
         else
         {
             MessageBox.Show(concept.Name);
         }
     }
 }
Ejemplo n.º 2
0
        public static MindMapConcept GetConcept(MyWordInfo word,MindMapOntology ontology)
        {
			foreach (KeyValuePair<string,MindMapConcept> pair in ontology.Concepts)
			{
				for (int i = 0; i < pair.Value.Maplex.Count; i++)
				{
					MyWordInfo maplex = pair.Value.Maplex[i];
					if (maplex.Pos==word.Pos&&maplex.Word.ToUpper()==word.Word.ToUpper()&&maplex.Sense==word.Sense)
						return pair.Value;
				}
			}
			return null;
        }