Esempio n. 1
0
        /// <summary>
        /// Trace meronyms.
        /// </summary>
        /// <param name="pbase"></param>
        /// <param name="fpos"></param>
        /// <param name="depth"></param>
        void traceInherit(PointerType pbase, PartOfSpeech fpos, int depth)
        {
            for (int i = 0; i < ptrs.Length; i++)
            {
                Pointer pt = ptrs[i];
                if (pt.ptp.Ident == HYPERPTR && (pt.sce == 0 || pt.sce == whichword))
                {
                    spaces("TRACEI", depth);
                    SynSet cursyn = new SynSet(pt.off, pt.pos, this);
                    search.wordsFrom(cursyn);
                    cursyn.str("=> ", "\n", 1, 0, 0, 1);
                    // TDMS 6 Oct 2005 - build hierarchical results
                    // TODO: verify this
                    if (this.senses == null)
                    {
                        this.senses = new SynSetList();
                    }
                    cursyn.thisptr = pt;                      // TDMS 17 Nov 2005 - add this pointer type
                    // TODO: This is adding senses incorrectly
                    this.senses.Add(cursyn);

                    cursyn.tracePtrs(pbase, PartOfSpeech.of("noun"), depth);
                    cursyn.tracePtrs(pbase + 1, PartOfSpeech.of("noun"), depth);
                    cursyn.tracePtrs(pbase + 2, PartOfSpeech.of("noun"), depth);
                    if (depth > 0)
                    {
                        depth = depthcheck(depth);
                        cursyn.traceInherit(pbase, cursyn.pos, depth + 1);
                    }
                }
            }
            search.trunc();
        }
Esempio n. 2
0
		/// <summary>
		/// Trace meronyms.
		/// </summary>
		/// <param name="pbase"></param>
		/// <param name="fpos"></param>
		/// <param name="depth"></param>
		void traceInherit(PointerType pbase, PartOfSpeech fpos, int depth)
		{
			for (int i = 0; i < ptrs.Length; i++)
			{
				Pointer pt = ptrs[i];
				if (pt.ptp.ident == HYPERPTR && (pt.sce == 0 || pt.sce == whichword))
				{
					spaces("TRACEI", depth);
					SynSet cursyn = new SynSet(pt.off, pt.pos, this);
					search.wordsFrom(cursyn);
					cursyn.str("=> ", "\n", 1, 0, 0, 1);
					// TDMS 6 Oct 2005 - build hierarchical results
					// TODO: verify this
					if (this.senses == null)
						this.senses = new SynSetList();
					cursyn.thisptr = pt;  // TDMS 17 Nov 2005 - add this pointer type
					// TODO: This is adding senses incorrectly
					this.senses.Add(cursyn);

					cursyn.tracePtrs(pbase, PartOfSpeech.of("noun"), depth);
					cursyn.tracePtrs(pbase + 1, PartOfSpeech.of("noun"), depth);
					cursyn.tracePtrs(pbase + 2, PartOfSpeech.of("noun"), depth);
					if (depth > 0)
					{
						depth = depthcheck(depth);
						cursyn.traceInherit(pbase, cursyn.pos, depth + 1);
					}
				}
			}
			search.trunc();
		}