Exemplo n.º 1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            MindMapConcept c = this._ontology.Concepts[this.cmbConcepts.SelectedItem.ToString()];

            this.nounResult   = new NounFrame(this.txtFrameText.Text, c);
            this.verbResult   = new VerbFrame(this.txtFrameText.Text, c);
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Exemplo n.º 2
0
        private MindMapConcept getNearestParent(List <MindMapConcept> list)
        {
            MindMapConcept Concept = list[0];

            for (int i = 0; i < list.Count - 1; i++)
            {
                DistanceInfo info = MindMapConcept.Distance(Concept, list[i + 1]);
                Concept = info.Parent;
            }

            return(Concept);
        }
Exemplo n.º 3
0
        //public int Sentence_ID
        //{
        //    get { return _S_ID; }
        //    set { _S_ID = value; }
        //}

        public NounFrame(string text, MindMapConcept c)
        {
            this.FrameType = Type.Noun;
            this._text     = text;
            this.Concept   = c;
        }
Exemplo n.º 4
0
        public Dictionary <MindMapConcept, List <Frame> > PartitionConcepts()
        {
            if (CurrentConcepts.Count > 1)
            {
                FrameDistance = new Dictionary <Frame, int>();

                foreach (Frame f1 in this.Frames)
                {
                    List <Frame> group = new List <Frame>();
                    group.Add(f1);
                    int Minimum = 2;
                    foreach (Frame f2 in this.Frames)
                    {
                        if (f1 != f2)
                        {
                            DistanceInfo info = MindMapConcept.Distance(f1.Concept, f2.Concept);
                            if (info.Distance < Minimum)
                            {
                                Minimum = info.Distance;
                                group.Clear();
                                group.Add(f1);
                                group.Add(f2);
                            }
                            else if (info.Distance == Minimum)
                            {
                                group.Add(f2);
                            }
                        }
                    }

                    FrameGroup.Add(f1, group);
                    FrameDistance.Add(f1, Minimum);
                }

                while (AllMarked() == false)
                {
                    List <Frame>          list     = getSmallestDistanceGroup();
                    List <MindMapConcept> concepts = new List <MindMapConcept>();
                    foreach (Frame f in list)
                    {
                        concepts.Add(f.Concept);
                    }

                    if (list.Count > 1)
                    {
                        MindMapConcept ParentConcept = getNearestParent(concepts);

                        List <Frame> frames = new List <Frame>();
                        foreach (Frame f in list)
                        {
                            FrameMarked[f] = true;
                            frames.Add(f);
                            CurrentConcepts.Remove(f.Concept);
                        }
                        CurrentConcepts.Add(ParentConcept, frames);
                    }
                    else
                    {
                        foreach (Frame f in list)
                        {
                            FrameMarked[f] = true;
                        }
                    }
                }
            }
            return(CurrentConcepts);
        }
Exemplo n.º 5
0
 public VerbFrame(string verbName, MindMapConcept c)
 {
     VerbName = verbName;
     Concept  = c;
 }