Beispiel #1
0
        /*
         * private void WordSenseDisambiguation(ParseTree parsetree)
         * {
         *   int j = 0;
         *   ArrayList arr = new ArrayList();
         *   if (parsetree.Root.Children != null)
         *   {
         *      words= wsd2(parsetree);
         *      foreach (string str in words)
         *      {
         *          string s = "";
         *          if (str == "NPP" || str == "PPJ")
         *          {
         *              s = str + ":" + parsetree.ResolvedAnaphora[j];
         *
         *          }
         *          else
         *          {
         *              s = str + ":" + parsetree.Words[j];
         *          }
         *          WordInfoArr.Add(s);
         *          j++;
         *      }
         *
         *      words = new ArrayList();
         *   }
         *   else
         *   {
         *
         *       //string str = parsetree.Words[j] + ":" + parsetree.Root.Goal.ToString();
         *       foreach (string str in words)
         *       {
         *            string s=str+":"+parsetree.Words[j]  ;
         *           WordInfoArr.Add(s);
         *           j++;
         *       }
         *
         *       words = new ArrayList();
         *
         *   }
         * }
         * private ArrayList wsd2(ParseTree parsetree)
         * {
         *
         *   ArrayList arr = new ArrayList();
         *   if (parsetree.Root.Children != null)
         *   {
         *       for (int i = 0; i < parsetree.Root.Children.Count; i++)
         *       {
         *           ParseNode pn = new ParseNode();
         *           pn = (ParseNode)parsetree.Root.Children[i];
         *           ParseTree p = new ParseTree(pn, parsetree.Words);
         *          words= wsd2(p);
         *       }
         *   }
         *   else
         *   {
         *       string goal = parsetree.Root.Goal;
         *       words.Add(goal);
         *
         *
         *   }
         *
         *   return words;
         * }
         */
        private void btnDiscourse_Click(object sender, EventArgs e)
        {
            ArrayList NewSParseTrees = new ArrayList();
            Discourse d        = new Discourse(SParseTrees);
            bool      modified = d.PrepareParseTrees();

            if (modified)
            {
                NewSParseTrees = d.NewSParseTrees;
                d.Begin(NewSParseTrees);
                Form2 f = new Form2();
                f.DisClasses = d.DistinctClasses;
                f.ParseTrees = NewSParseTrees;
                f.ShowDialog(this);
                d.ReturnSParseTrees();
                SParseTrees = d.SParseTrees;
            }
            else
            {
                d.Begin(SParseTrees);
                Form2 f = new Form2();
                f.DisClasses = d.DistinctClasses;
                f.ParseTrees = SParseTrees;
                f.ShowDialog(this);
            }
        }
Beispiel #2
0
        private void DiscourseAnalysis()
        {
            ArrayList NewSParseTrees = new ArrayList();
            Discourse d        = new Discourse(SParseTrees);
            bool      modified = d.PrepareParseTrees();

            if (modified)
            {
                NewSParseTrees = d.NewSParseTrees;
                d.Begin(NewSParseTrees);
                Form2 f = new Form2();
                f.DisClasses = d.DistinctClasses;
                f.ParseTrees = NewSParseTrees;
                f.assigndiscoursedata();

                //f.ShowDialog(this);

                d.ReturnSParseTrees();
                SParseTrees = d.SParseTrees;
            }
            else
            {
                d.Begin(SParseTrees);
                Form2 f = new Form2();
                f.DisClasses = d.DistinctClasses;
                f.ParseTrees = SParseTrees;
                f.assigndiscoursedata();
                //f.ShowDialog(this);
            }
        }
Beispiel #3
0
        private void DiscourseAnalysis()
        {
            ArrayList NewSParseTrees = new ArrayList();
            Discourse d        = new Discourse(SParseTrees);
            bool      modified = d.PrepareParseTrees();

            if (modified)
            {
                NewSParseTrees = d.NewSParseTrees;
                d.Begin(NewSParseTrees);
                DisplayDiscourseRes(d.DistinctClasses, NewSParseTrees);
                d.assigndiscoursedata(d.DistinctClasses, NewSParseTrees);
                d.ReturnSParseTrees();
                SParseTrees = d.SParseTrees;
            }
            else
            {
                d.Begin(SParseTrees);
                DisplayDiscourseRes(d.DistinctClasses, SParseTrees);
                d.assigndiscoursedata(d.DistinctClasses, SParseTrees);
            }
        }