Beispiel #1
0
        public void OverviewFor(string t, string p, ref bool b, ref SearchSet obj, ArrayList list)
        {
            PartOfSpeech pos         = Wnlib.PartOfSpeech.of(p);
            SearchSet    ss          = Wnlib.WNDB.is_defined(t, pos);
            MorphStr     ms          = new Wnlib.MorphStr(t, pos);
            bool         checkmorphs = false;

            checkmorphs = AddSearchFor(t, pos, list);             // do a search
            string m;

            if (checkmorphs)
            {
                WN.hasmatch = true;
            }

            if (!hasmatch)
            {
                // loop through morphs (if there are any)
                while ((m = ms.next()) != null)
                {
                    if (m != t)
                    {
                        ss = ss + WNDB.is_defined(m, pos);
                        AddSearchFor(m, pos, list);
                    }
                }
            }
            b   = ss.NonEmpty;
            obj = ss;
        }
        public void OverviewFor(string t, string p, ref bool b, ref SearchSet obj, ArrayList list)
        {
            PartOfSpeech pos         = Wnlib.PartOfSpeech.of(p);
            SearchSet    ss          = Wnlib.WNDB.is_defined(t, pos);
            MorphStr     ms          = new Wnlib.MorphStr(t, pos);
            bool         checkmorphs = false;

            hasmatch = false;                         //TODO: if this isn't reset then morphs aren't checked on subsequent searches - check for side effects of resetting this manually

            checkmorphs = AddSearchFor(t, pos, list); // do a search
            string m;

            if (checkmorphs)
            {
                WN.hasmatch = true;
            }

            if (!hasmatch)
            {
                // loop through morphs (if there are any)
                while ((m = ms.next()) != null)
                {
                    if (m != t)
                    {
                        ss = ss + WNDB.is_defined(m, pos);
                        AddSearchFor(m, pos, list);
                    }
                }
            }
            b   = ss.NonEmpty;
            obj = ss;
        }