コード例 #1
0
ファイル: wordnet.cs プロジェクト: yehudapashay/Search-Engine
        /// <summary>
        /// Performs a search based on the parameters setup
        /// in the Search constructor.
        /// </summary>
        /// <param name="doMorphs">Specifies whether to perform a search on morphs.
        /// This parameter is retrieved in the first
        /// call from do_search(bool m, string p).  If morph searching is specified
        /// and a morph is found, then on a recursive call to this method
        /// morphing will be turned off to prevent unnecessary morph searching.</param>
        internal void do_search(bool doMorphs)
        {
            findtheinfo();
            if (buf.Length > 0)
            {
                buf = "\n" + sch.label + " of " + pos.name + " " + word + "\n" + buf;
            }
            if (!doMorphs)
            {
                return;
            }
            morphs = new Hashtable();
            MorphStr st = new MorphStr(word, pos);
            string   morphword;

            // if there are morphs then perform iterative searches
            // on each morph, filling the morph tree in the search
            // object.
            while ((morphword = st.next()) != null)
            {
                Search s = new Search(morphword, pos, sch, whichsense);
                s.do_search(false);
                // Fill the morphlist - eg. if verb relations of 'drunk' are requested, none are directly
                // found, but the morph 'drink' will have results.  The morph hashtable will be populated
                // into the search results and should be iterated instead of the returned synset if the
                // morphs are non-empty
                morphs[morphword] = s;
                buf += s.buf;
            }
        }
コード例 #2
0
ファイル: wordnet.cs プロジェクト: yehudapashay/Search-Engine
        /// <summary>
        /// Performs a search based on the parameters setup
        /// in the Search constructor.
        /// </summary>
        /// <param name="doMorphs">Specify if morphs should be searched</param>
        /// <param name="thePartOfSpeech">The Part Of Speech to perform the search on</param>
        public void do_search(bool doMorphs, string thePartOfSpeech)
        {
            if (parts == null)
            {
                parts = new Hashtable();
            }
            Search s = new Search(word, PartOfSpeech.of(thePartOfSpeech), sch, whichsense);

            s.do_search(doMorphs);
            parts[thePartOfSpeech] = s;
            buf += s.buf;
        }
コード例 #3
0
ファイル: wordnet.cs プロジェクト: hajarSA/d
        /// <summary>
        /// Performs a search based on the parameters setup
        /// in the Search constructor.
        /// </summary>
        /// <param name="m">Specify if morphs should be searched</param>
        /// <param name="p">The Part Of Speech to perform the search on</param>
        public void do_search(bool m, string p)
        {
            if (parts == null)
            {
                parts = new Hashtable();
            }
            Search s = new Search(word, PartOfSpeech.of(p), sch, whichsense);

            s.do_search(m);
            parts[p] = s;
            buf     += s.buf;
        }
コード例 #4
0
ファイル: wordnet.cs プロジェクト: Shoop123/Reworder-C-Sharp
		/// <summary>
		/// Performs a search based on the parameters setup
		/// in the Search constructor.
		/// </summary>
		/// <param name="m">Specify if morphs should be searched</param>
		/// <param name="p">The Part Of Speech to perform the search on</param>
		public void do_search(bool m, string p)
		{
			if (parts == null)
				parts = new Hashtable();
			Search s = new Search(word, PartOfSpeech.of(p), sch, whichsense);
			s.do_search(m);
			parts[p] = s;
			buf += s.buf;
		}
コード例 #5
0
ファイル: wordnet.cs プロジェクト: Shoop123/Reworder-C-Sharp
		/// <summary>
		/// Performs a search based on the parameters setup
		/// in the Search constructor.
		/// </summary>
		/// <param name="doMorphs">Specifies whether to perform a search on morphs.  
		/// This parameter is retrieved in the first
		/// call from do_search(bool m, string p).  If morph searching is specified
		/// and a morph is found, then on a recursive call to this method
		/// morphing will be turned off to prevent unnecessary morph searching.</param>
		internal void do_search(bool doMorphs)
		{
			findtheinfo();
			if (buf.Length > 0)
				buf = "\n" + sch.label + " of " + pos.name + " " + word + "\n" + buf;
			if (!doMorphs)
				return;
			morphs = new Hashtable();
			MorphStr st = new MorphStr(word, pos);
			string morphword;

			// if there are morphs then perform iterative searches
			// on each morph, filling the morph tree in the search
			// object.
			while ((morphword = st.next()) != null)
			{
				Search s = new Search(morphword, pos, sch, whichsense);
				s.do_search(false);
				// Fill the morphlist - eg. if verb relations of 'drunk' are requested, none are directly 
				// found, but the morph 'drink' will have results.  The morph hashtable will be populated 
				// into the search results and should be iterated instead of the returned synset if the 
				// morphs are non-empty
				morphs[morphword] = s;
				buf += s.buf;
			}
		}