예제 #1
0
        }         // for serialization

        public SynSet(int offset, PartOfSpeech p, string wd, Search sch, int sens)
        {
            pos     = p;
            hereiam = offset;
            search  = sch;
            sense   = sens;
            StreamReader f = WNDB.data(p);

            f.DiscardBufferedData();
            //f.BaseStream.Seek(off,SeekOrigin.Begin);
            f.BaseStream.Position = offset;
            string rec = f.ReadLine();

            //string str;
            if (!rec.StartsWith(offset.ToString("D8")))
            {
                Console.WriteLine("Error reading " + p.name + " file! " + offset + ": " + rec);
                WNDB.reopen(p);
                f = WNDB.data(p);
                f.DiscardBufferedData();
                //f.BaseStream.Seek(off, SeekOrigin.Begin);
                f.BaseStream.Position = offset;
                rec = f.ReadLine();
                //if (!rec.StartsWith(off.ToString("D8")))
                //    str = "";
                //else
                //    Console.WriteLine("Recovered...");
            }
            Parse(rec, pos, wd);
        }
예제 #2
0
파일: util.cs 프로젝트: ywscr/MindMap
 public Indexes(string str, PartOfSpeech pos)
 {
     string[] strings = new string[stringscount];
     str        = str.ToLower();
     strings[0] = str;
     strings[1] = str.Replace('_', '-');
     strings[2] = str.Replace('-', '_');
     strings[3] = str.Replace("-", "").Replace("_", "");
     strings[4] = str.Replace(".", "");
     // TDMS - 14 Aug 2005 - added two more possibilities
     // to allow for spaces to be transformed
     // an example is a search for "11 plus", without this
     // transformation no result would be found
     strings[5] = str.Replace(' ', '-');
     strings[6] = str.Replace(' ', '_');
     offsets[0] = Index.lookup(str, pos);
     // TDMS - 14 Aug 2005 - changed 5 to 7 to allow for two
     // new possibilities
     for (int i = 1; i < stringscount; i++)
     {
         if (str != strings[i])
         {
             offsets[i] = Index.lookup(strings[i], pos);
         }
     }
     fpos = pos;
 }
예제 #3
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();
        }
예제 #4
0
 public static void reopen(PartOfSpeech p)
 {
     index(p).Close();
     data(p).Close();
     indexfps[p.key] = GetStreamReader(IndexFile(p));
     datafps[p.key]  = GetStreamReader(DataFile(p));
 }
예제 #5
0
        void catword(int wdnum, int adjmarker, int antflag)
        {
            search.buf += deadjify(words[wdnum].word);

            /* Print additional lexicographer information and WordNet sense
             * number as indicated by flags */
            if (words[wdnum].uniq != 0)
            {
                search.buf += "" + words[wdnum].uniq;
            }
            int s = getsearchsense(wdnum + 1);

            words[wdnum].wnsns = s;
            if (WNOpt.opt("-s").flag)
            {
                search.buf += "#" + s;
            }

            /* For adjectives, append adjective marker if present, and
             * print antonym if flag is passed */
            if (pos.name == "adj")
            {
                if (adjmarker > 0)
                {
                    search.buf += "" + adj_marker.mark;
                }
                if (antflag > 0)
                {
                    strAnt(PartOfSpeech.of("adj"), wdnum + 1, "(vs. ", ")");
                }
            }
        }
예제 #6
0
 internal Search(string w, PartOfSpeech p, SearchType s, int sn)
 {
     word       = w;
     pos        = p;
     sch        = s;
     whichsense = sn;
 }
예제 #7
0
		internal Search(string w, PartOfSpeech p, SearchType s, int sn)
		{
			word = w;
			pos = p;
			sch = s;
			whichsense = sn;
		}
예제 #8
0
		/* From search.c:
		 * Find word in index file and return parsed entry in data structure.
		   Input word must be exact match of string in database. */

		// From the WordNet Manual (http://wordnet.princeton.edu/man/wnsearch.3WN.html)
		// index_lookup() finds searchstr in the index file for pos and returns a pointer 
		// to the parsed entry in an Index data structure. searchstr must exactly match the 
		// form of the word (lower case only, hyphens and underscores in the same places) in 
		// the index file. NULL is returned if a match is not found.
		public static Index lookup(string word, PartOfSpeech pos)
		{
			int j;
			if (word == "")
				return null;
			// TDMS 14 Aug 2005 - changed to allow for numbers as well
			// because the database contains searches that can start with
			// numerals
			//if (!char.IsLetter(word[0]))
			if (!char.IsLetter(word[0]) && !char.IsNumber(word[0]))
				return null;
			string line = WNDB.binSearch(word, pos);
			if (line == null)
				return null;
			Index idx = new Index();
			StrTok st = new StrTok(line);
			idx.Wd = st.next(); /* the word */
			idx.PartOfSpeech = PartOfSpeech.of(st.next()); /* the part of speech */
			idx.SenseCnt = int.Parse(st.next()); /* collins count */
			int ptruse_cnt = int.Parse(st.next()); /* number of pointers types */
			idx.Ptruse = new PointerType[ptruse_cnt];
			for (j = 0; j < ptruse_cnt; j++)
				idx.Ptruse[j] = PointerType.of(st.next());
			int off_cnt = int.Parse(st.next());
			idx.SynsetOffsets = new int[off_cnt];
			idx.TaggedSensesCount = int.Parse(st.next());
			for (j = 0; j < off_cnt; j++)
				idx.SynsetOffsets[j] = int.Parse(st.next());
			return idx;
		}
예제 #9
0
파일: util.cs 프로젝트: ywscr/MindMap
        internal static ArrayList wngrep(string wordPassed, PartOfSpeech pos)
        {
            ArrayList    r         = new ArrayList();
            StreamReader inputFile = index(pos);

            inputFile.BaseStream.Seek(0L, SeekOrigin.Begin);
            inputFile.DiscardBufferedData();
            string word = wordPassed.Replace(" ", "_");
            string line;

            while ((line = inputFile.ReadLine()) != null)
            {
                int lineLen = line.IndexOf(' ');
                line = line.Substring(0, lineLen);
                try
                {
                    if (line.IndexOf(word) >= 0)
                    {
                        r.Add(line.Replace("_", " "));
                    }
                }
                catch
                {
                }
            }
            return(r);
        }
예제 #10
0
파일: morph.cs 프로젝트: ywscr/MindMap
 public Exceptions(string word, PartOfSpeech pos)
 {
     line = WNDB.binSearch(word, excfps[pos.ident]);
     if (line != null)
     {
         endlp = line.IndexOf(' ');
     }
 }
예제 #11
0
 public Exceptions(string word, PartOfSpeech pos)
 {
     line = WNDB.binSearch(word, (StreamReader)excfps[pos.key]);
     if (line != null)
     {
         endlp = line.IndexOf(' ');
     }
 }
예제 #12
0
	    static bool AddSearchFor(string s, PartOfSpeech pos, ArrayList list)
		{
			var se = new Search(s, false, pos, new SearchType(false, "OVERVIEW"), 0);
			if (se.lexemes.Count > 0)
				list.Add(se);

			return se.lexemes.Count > 0;
		}
예제 #13
0
 public Search(string w, bool doMorphs, PartOfSpeech p, SearchType s, int sn)
     : this(w, p, s, sn)
 {
     if (p != null)
     {
         do_search(doMorphs);
     }
 }
예제 #14
0
 public Search(string w, bool doMorphs, PartOfSpeech p, SearchType s, int sn, CustomGrep cg)
     : this(w, p, s, sn)
 {
     customgrep = cg;
     if (p != null)
     {
         do_search(doMorphs);
     }
 }
예제 #15
0
파일: util.cs 프로젝트: ywscr/MindMap
        public static void reopen(PartOfSpeech p)
        {
            WNDBpart w = WNDBpart.of(p);

            w.index.Close();
            w.data.Close();
            w.index = new StreamReader(IndexFile(p));
            w.data  = new StreamReader(DataFile(p));
        }
예제 #16
0
파일: morph.cs 프로젝트: ywscr/MindMap
        static Exceptions()
        {
            excfps = new StreamReader[PartOfSpeech.parts.Count];
            IDictionaryEnumerator d = PartOfSpeech.parts.GetEnumerator();

            while (d.MoveNext())
            {
                PartOfSpeech p = (PartOfSpeech)(d.Value);
                excfps[p.ident] = new StreamReader(WNDB.ExcFile(p));
            }
        }
예제 #17
0
파일: Class1.cs 프로젝트: cuiwanyun/KBQA
        bool AddSearchFor(string s,PartOfSpeech pos, ArrayList list)
        {
            Search se = new Search(s,false,pos,new SearchType(false,"OVERVIEW"),0);
            if(se.lexemes.Count > 0)
                list.Add(se);

            if(se.lexemes.Count > 0)
                return true; // results were found
            else
                return false;
        }
예제 #18
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;
        }
예제 #19
0
        /// <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;
        }
예제 #20
0
        internal void strAnt(PartOfSpeech pos, int wdnum, string head, string tail)
        {
            int i, j, wdoff;

            /* Go through all the pointers looking for anotnyms from the word
             * indicated by wdnum.  When found, print all the antonym's
             * antonym pointers which point back to wdnum. */
            for (i = 0; i < ptrs.Length; i++)
            {
                Pointer pt = ptrs[i];
                if (pt.ptp.Ident == ANTPTR && pt.sce == wdnum)
                {
                    SynSet psyn = new SynSet(pt.off, pos, this);
                    for (j = 0; j < psyn.ptrs.Length; j++)
                    {
                        Pointer ppt = psyn.ptrs[j];
                        if (ppt.ptp.Ident == ANTPTR &&
                            ppt.dst == wdnum &&
                            ppt.off == hereiam)
                        {
                            wdoff       = ppt.sce > 0 ? ppt.sce - 1 : 0;
                            search.buf += head;

                            /* Construct buffer containing formatted antonym,
                             * then add it onto end of return buffer */
                            search.buf += deadjify(psyn.words[wdoff].word);

                            /* Print additional lexicographer information and
                             * WordNet sense number as indicated by flags */
                            isDirty = true;                             // TDMS 19 July 2006 - attempt to tie the logic which
                            // populates buf to the logic that defines whether the
                            // synset is populated with relevant information

                            if (search.prlexid && psyn.words[wdoff].uniq != 0)
                            {
                                search.buf += psyn.words[wdoff].uniq;
                            }
                            int s = getsearchsense(wdoff + 1);
                            psyn.words[wdoff].wnsns = s;
                            if (WnOpt.Opt("-s").Flag)
                            {
                                search.buf += "#" + s;
                                isDirty     = true;                             // TDMS 19 July 2006 - attempt to tie the logic which
                                // populates buf to the logic that defines whether the
                                // synset is populated with relevant information
                            }
                            search.buf += tail;
                        }
                    }
                }
            }
        }
예제 #21
0
        void strAnt(string tail, AdjSynSetType attype, int definition)
        {
            int  i, wdcnt;
            bool first = true;

            if (WnOpt.Opt("-o").Flag)
            {
                search.buf += "(" + hereiam + ") ";
            }
            if (WnOpt.Opt("-a").Flag)
            {
                search.buf    += "<" + WNDB.lexfiles[fnum] + "> ";
                search.prlexid = true;
            }
            else
            {
                search.prlexid = false;
            }
            /* print antonyms from cluster head (of indirect ant) */
            search.buf += "INDIRECT (VIA ";
            for (i = 0, wdcnt = words.Length; i < wdcnt; i++)
            {
                if (first)
                {
                    strAnt(PartOfSpeech.of("adj"), i + 1, "", ", ");
                    first = false;
                }
                else
                {
                    strAnt(PartOfSpeech.of("adj"), i + 1, ", ", ", ");
                }
            }
            search.buf += ") -> ";
            /* now print synonyms from cluster head (of indirect ant) */
            for (i = 0, wdcnt = words.Length; i < wdcnt; i++)
            {
                catword(i, 0, 0);
                if (i < wdcnt - 1)
                {
                    search.buf += ", ";
                }
            }
            if (WnOpt.Opt("-g").Flag&& defn != null && definition != 0)
            {
                search.buf += " -- " + defn;

                isDirty = true;                 // TDMS 19 July 2006 - attempt to tie the logic which
                // populates buf to the logic that defines whether the
                // synset is populated with relevant information
            }
            search.buf += tail;
        }
예제 #22
0
		public MorphStr(string s, PartOfSpeech p)
		{
			string origstr = s;
			pos = p;
			if (pos.clss == "SATELLITE")
				pos = PartOfSpeech.of("adj");
			/* Assume string hasnt had spaces substitued with _ */
			str = origstr.Replace(' ', '_').ToLower();
			searchstr = "";
			cnt = str.Split('_').Length;
			svprep = 0;
			firsttime = true;
		}
예제 #23
0
        static Exceptions()
        {
            IDictionaryEnumerator d = PartOfSpeech.parts.GetEnumerator();

            while (d.MoveNext())
            {
                PartOfSpeech p = (PartOfSpeech)(d.Value);
                if (!excfps.ContainsKey(p.key))
                {
                    excfps[p.key] = WNDB.GetStreamReader(WNDB.ExcFile(p));
                }
            }
        }
예제 #24
0
        /// <summary>
        /// Trace coordinate terms.
        /// </summary>
        /// <param name="ptp"></param>
        /// <param name="fpos"></param>
        /// <param name="depth"></param>
        internal void traceCoords(PointerType ptp, PartOfSpeech fpos, int depth)
        {
            for (int i = 0; i < ptrs.Length; i++)
            {
                Pointer pt = ptrs[i];

                /* WN2.0
                 *                              if (pt.ptp.mnemonic=="HYPERPTR" &&
                 *                                      (pt.sce==0 ||
                 *                                       pt.sce==whichword))
                 */
                // WN2.1 if statement change - TDMS
                if ((pt.ptp.Ident == HYPERPTR || pt.ptp.Ident == INSTANCE) &&
                    ((pt.sce == 0) ||
                     (pt.sce == whichword)))
                {
                    if (!search.prflag)
                    {
                        strsns(sense + 1);
                        search.prflag = true;
                    }
                    spaces("TRACEC", depth);
                    SynSet cursyn = new SynSet(pt.off, pt.pos, this);
                    search.wordsFrom(cursyn);
                    cursyn.str("-> ", "\n", 1, 0, 0, 1);
                    cursyn.tracePtrs(ptp, cursyn.pos, depth);
                    // TDMS 6 Oct 2005 - build hierarchical results
                    if (this.senses == null)
                    {
                        this.senses = new SynSetList();
                    }
                    cursyn.thisptr = pt;                      // TDMS 17 Nov 2005 - add this pointer type
                    this.senses.Add(cursyn);

                    if (depth > 0)
                    {
                        depth = depthcheck(depth);
                        cursyn.traceCoords(ptp, cursyn.pos, depth + 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
                        this.senses.Add(cursyn);
                    }
                }
            }
        }
예제 #25
0
파일: util.cs 프로젝트: ywscr/MindMap
 public WNDBpart(PartOfSpeech p)
 {
     try
     {
         index  = new StreamReader(WNDB.IndexFile(p));
         data   = new StreamReader(WNDB.DataFile(p));
         fps[p] = this;
     }
     catch
     {
         // TODO: handle bad dict path
         // ignore errors - as the user is locating the dictionary location
         // wordnet classes are trying to instantiate based on an incorrect dict path
     }
 }
예제 #26
0
파일: morph.cs 프로젝트: cuiwanyun/KBQA
        public Exceptions(string word,PartOfSpeech pos)
        {
            if(laststr != ((System.IO.FileStream)(excfps[pos.ident].BaseStream)).Name)
            {
                laststr = ((System.IO.FileStream)(excfps[pos.ident].BaseStream)).Name;
                StreamReader fs = excfps[pos.ident];
                Byte[] b = System.Text.Encoding.Unicode.GetBytes(fs.ReadToEnd());
                excfps[pos.ident].BaseStream.Seek(0, SeekOrigin.Begin);

                exc = new MemoryStream(b);
            }
            line = WNDB.binSearch(word,exc); //excfps[pos.ident]);
            if (line!=null)
                endlp = line.IndexOf(' ');
        }
예제 #27
0
        void strAnt(string tail, AdjSynSetType attype, int definition)
        {
            int  i, wdcnt;
            bool first = true;

            if (WNOpt.opt("-o").flag)
            {
                search.buf += "(" + hereiam + ") ";
            }
            if (WNOpt.opt("-a").flag)
            {
                search.buf    += "<" + WNDB.lexfiles[fnum] + "> ";
                search.prlexid = true;
            }
            else
            {
                search.prlexid = false;
            }
            /* print antonyms from cluster head (of indirect ant) */
            search.buf += "INDIRECT (VIA ";
            for (i = 0, wdcnt = words.Length; i < wdcnt; i++)
            {
                if (first)
                {
                    strAnt(PartOfSpeech.of("adj"), i + 1, "", ", ");
                    first = false;
                }
                else
                {
                    strAnt(PartOfSpeech.of("adj"), i + 1, ", ", ", ");
                }
            }
            search.buf += ") -> ";
            /* now print synonyms from cluster head (of indirect ant) */
            for (i = 0, wdcnt = words.Length; i < wdcnt; i++)
            {
                catword(i, 0, 0);
                if (i < wdcnt - 1)
                {
                    search.buf += ", ";
                }
            }
            if (WNOpt.opt("-g").flag&&  defn != null && definition != 0)
            {
                search.buf += " -- " + defn;
            }
            search.buf += tail;
        }
예제 #28
0
 public static MemoryStream index(PartOfSpeech p)         //StreamReader index(PartOfSpeech p)
 {
     if (laststr == ((System.IO.FileStream)(WNDBpart.of(p).index.BaseStream)).Name)
     {
         return(ms); //WNDBpart.of(p).index;
     }
     else
     {
         laststr = ((System.IO.FileStream)(WNDBpart.of(p).index.BaseStream)).Name;
         StreamReader fs = WNDBpart.of(p).index;
         fs.BaseStream.Position = 0;
         Byte[] b = System.Text.Encoding.Unicode.GetBytes(fs.ReadToEnd());
         ms = new MemoryStream(b);
         return(ms);            //WNDBpart.of(p).index;
     }
 }
예제 #29
0
파일: morph.cs 프로젝트: ywscr/MindMap
        public MorphStr(string s, PartOfSpeech p)
        {
            string origstr = s;

            pos = p;
            if (pos.clss == "SATELLITE")
            {
                pos = PartOfSpeech.of("adj");
            }
            /* Assume string hasnt had spaces substitued with _ */
            str       = origstr.Replace(' ', '_').ToLower();
            searchstr = "";
            cnt       = str.Split('_').Length;
            svprep    = 0;
            firsttime = true;
        }
예제 #30
0
        public void beginDisambiguate()
        {
            Disambiguate(SParseTrees);
            ///////////////////////////get the text of senses ///////////////////////
            for (int i = 0; i < NewParseTreeSenses.Count; i++)
            {
                MyWordInfo[] mwiArr = (MyWordInfo[])NewParseTreeSenses[i];
                ParseTree    pt;
                pt = (ParseTree)NewSParseTrees[i];
                AddArrStems(NewSParseTrees);
                for (int j = 0; j < mwiArr.Length; j++)
                {
                    Wnlib.PartOfSpeech p = Wnlib.PartOfSpeech.of((Wnlib.PartsOfSpeech)mwiArr[j].Pos);
                    try
                    {
                        //i need the stems here to get index
                        Wnlib.Index index = Wnlib.Index.lookup(mwiArr[j].Word.ToLower(), p);
                        SynSet      sense = new SynSet(index, mwiArr[j].Sense, null);
                        NodesSenses.Add(sense.defn);
                        SensesNos.Add(mwiArr[j].Sense);

                        string s = mwiArr[j].Word.ToLower() + " : " + sense.defn;
                        DisambRes.Add(s);
                    }
                    catch
                    {
                        try
                        {
                            Wnlib.Index index = Wnlib.Index.lookup(Stems[j], p);
                            SynSet      sense = new SynSet(index, mwiArr[j].Sense, null);
                            NodesSenses.Add(sense.defn);
                            SensesNos.Add(mwiArr[j].Sense);

                            string s = Stems[j].ToLower() + " : " + sense.defn;
                            DisambRes.Add(s);
                        }
                        catch
                        { };
                    };
                }
                Senses = NodesSenses;
            }
            //////////////////////////add sense text & sense no to the nodes//////////////////////////////
            AddNodesSenses(NewSParseTrees);
            //////////////////////////put the output parsetrees in SparseTree again//////////////////////////////
            SParseTrees = NewSParseTrees;
        }
예제 #31
0
        public Exceptions(string word, PartOfSpeech pos)
        {
            if (laststr != ((System.IO.FileStream)(excfps[pos.ident].BaseStream)).Name)
            {
                laststr = ((System.IO.FileStream)(excfps[pos.ident].BaseStream)).Name;
                StreamReader fs = excfps[pos.ident];
                Byte[]       b  = System.Text.Encoding.Unicode.GetBytes(fs.ReadToEnd());
                excfps[pos.ident].BaseStream.Seek(0, SeekOrigin.Begin);

                exc = new MemoryStream(b);
            }
            line = WNDB.binSearch(word, exc);            //excfps[pos.ident]);
            if (line != null)
            {
                endlp = line.IndexOf(' ');
            }
        }
예제 #32
0
파일: util.cs 프로젝트: ywscr/MindMap
 Opt(string a, string m, string p, int h, string b)
 {
     arg = a;
     if (m[0] == '-')
     {
         sch = new SearchType(true, m.Substring(1));
     }
     else
     {
         sch = new SearchType(false, m);
     }
     pos   = PartOfSpeech.of(p.ToLower());
     helpx = h;
     label = b;
     id    = opts.Count;
     opts.Add(this);
 }
예제 #33
0
        internal void strAnt(PartOfSpeech pos, int wdnum, string head, string tail)
        {
            int i, j, wdoff;

            /* Go through all the pointers looking for anotnyms from the word
             * indicated by wdnum.  When found, print all the antonym's
             * antonym pointers which point back to wdnum. */
            for (i = 0; i < ptrs.Length; i++)
            {
                Pointer pt = ptrs[i];
                if (pt.ptp.mnemonic == "ANTPTR" && pt.sce == wdnum)
                {
                    SynSet psyn = new SynSet(pt.off, pos, this);
                    for (j = 0; j < psyn.ptrs.Length; j++)
                    {
                        Pointer ppt = psyn.ptrs[j];
                        if (ppt.ptp.mnemonic == "ANTPTR" &&
                            ppt.dst == wdnum &&
                            ppt.off == hereiam)
                        {
                            wdoff       = ppt.sce > 0?ppt.sce - 1:0;
                            search.buf += head;

                            /* Construct buffer containing formatted antonym,
                             * then add it onto end of return buffer */
                            search.buf += deadjify(psyn.words[wdoff].word);

                            /* Print additional lexicographer information and
                             * WordNet sense number as indicated by flags */
                            if (search.prlexid && psyn.words[wdoff].uniq != 0)
                            {
                                search.buf += psyn.words[wdoff].uniq;
                            }
                            int s = getsearchsense(wdoff + 1);
                            psyn.words[wdoff].wnsns = s;
                            if (WNOpt.opt("-s").flag)
                            {
                                search.buf += "#" + s;
                            }
                            search.buf += tail;
                        }
                    }
                }
            }
        }
예제 #34
0
파일: Index.cs 프로젝트: hajarSA/d
        /* From search.c:
         * Find word in index file and return parsed entry in data structure.
         * Input word must be exact match of string in database. */

        // From the WordNet Manual (http://wordnet.princeton.edu/man/wnsearch.3WN.html)
        // index_lookup() finds searchstr in the index file for pos and returns a pointer
        // to the parsed entry in an Index data structure. searchstr must exactly match the
        // form of the word (lower case only, hyphens and underscores in the same places) in
        // the index file. NULL is returned if a match is not found.
        public static Index lookup(string word, PartOfSpeech pos)
        {
            int j;

            if (word == "")
            {
                return(null);
            }
            // TDMS 14 Aug 2005 - changed to allow for numbers as well
            // because the database contains searches that can start with
            // numerals
            //if (!char.IsLetter(word[0]))
            if (!char.IsLetter(word[0]) && !char.IsNumber(word[0]))
            {
                return(null);
            }
            string line = WNDB.binSearch(word, pos);

            if (line == null)
            {
                return(null);
            }
            Index  idx = new Index();
            StrTok st  = new StrTok(line);

            idx.wd        = st.next();                  /* the word */
            idx.pos       = PartOfSpeech.of(st.next()); /* the part of speech */
            idx.sense_cnt = int.Parse(st.next());       /* collins count */
            int ptruse_cnt = int.Parse(st.next());      /* number of pointers types */

            idx.ptruse = new PointerType[ptruse_cnt];
            for (j = 0; j < ptruse_cnt; j++)
            {
                idx.ptruse[j] = PointerType.of(st.next());
            }
            int off_cnt = int.Parse(st.next());

            idx.offs         = new int[off_cnt];
            idx.tagsense_cnt = int.Parse(st.next());
            for (j = 0; j < off_cnt; j++)
            {
                idx.offs[j] = int.Parse(st.next());
            }
            return(idx);
        }
예제 #35
0
        static WNDB()
        {
            //Console.WriteLine("WNDB");
            path = WNCommon.path;
            IDictionaryEnumerator d = PartOfSpeech.parts.GetEnumerator();

            while (d.MoveNext())
            {
                PartOfSpeech p = (PartOfSpeech)(d.Value);
                if (!indexfps.ContainsKey(p.key))
                {
                    indexfps[p.key] = GetStreamReader(IndexFile(p));
                }
                if (!datafps.ContainsKey(p.key))
                {
                    datafps[p.key] = GetStreamReader(DataFile(p));
                }
            }
        }
예제 #36
0
파일: util.cs 프로젝트: ywscr/MindMap
 public static PartOfSpeech of(PartsOfSpeech f)
 {
     if (f == PartsOfSpeech.Noun)
     {
         return(PartOfSpeech.of("noun"));
     }
     if (f == PartsOfSpeech.Verb)
     {
         return(PartOfSpeech.of("verb"));
     }
     if (f == PartsOfSpeech.Adj)
     {
         return(PartOfSpeech.of("adj"));
     }
     if (f == PartsOfSpeech.Adv)
     {
         return(PartOfSpeech.of("adv"));
     }
     return(null);                               // unknown or not unique
 }
예제 #37
0
		/// <summary>
		/// Traces pointer hierarchy.
		/// </summary>
		/// <param name="stp"></param>
		/// <param name="fpos"></param>
		/// <param name="depth"></param>
		internal void tracePtrs(SearchType stp, PartOfSpeech fpos, int depth)
		{
			int i;
			SynSet cursyn;
			PointerType ptp = stp.ptp;
			string prefix;
			int realptr; // WN2.1

			for (i = 0; i < ptrs.Length; i++)
			{
				Pointer pt = ptrs[i];
				// following if statement is WN2.1 - TDMS
				if ((ptp.ident == HYPERPTR && (pt.ptp.ident == HYPERPTR ||
					pt.ptp.ident == INSTANCE)) ||
					(ptp.ident == HYPOPTR && (pt.ptp.ident == HYPOPTR ||
					pt.ptp.ident == INSTANCES)) ||
					((pt.ptp == ptp) &&
					((pt.sce == 0) ||
					(pt.sce == whichword))))
				{
					realptr = pt.ptp.ident; /* WN2.1 deal with INSTANCE */
					if (!search.prflag) // print sense number and synset
						strsns(sense + 1);
					search.prflag = true;
					spaces("TRACEP", depth + (stp.rec ? 2 : 0));
					//					switch (ptp.mnemonic) 
					// TDMS 11 JUL 2006 - changed switch to ident	switch (pt.ptp.mnemonic) // TDMS - WN2.1 MOD
					switch (pt.ptp.ident) // TDMS 11 JUL 2006 - changed switch to ident
					{
						case PERTPTR:
							if (fpos.name == "adv") // TDMS "adverb")
								prefix = "Derived from " + pt.pos.name + " ";
							else
								prefix = "Pertains to " + pt.pos.name + " ";
							break;
						case ANTPTR: // TDMS 26/8/05
							if (fpos.name == "adj") //TODO: which adjective will fall into the below?
								prefix = "Antonym of ";
							else
								prefix = "";
							break;
						case PPLPTR:
							prefix = "Participle of verb";
							break;
						case INSTANCE:
							prefix = "INSTANCE OF=> ";
							break;
						case INSTANCES:
							prefix = "HAS INSTANCE=> ";
							break;
						case HASMEMBERPTR:
							prefix = "   HAS MEMBER: ";
							break;
						case HASSTUFFPTR:
							prefix = "   HAS SUBSTANCE: ";
							break;
						case HASPARTPTR:
							prefix = "   HAS PART:  ";
							break;
						case ISMEMBERPTR:
							prefix = "   MEMBER OF:  ";
							break;
						case ISSTUFFPTR: // TDMS 26/8/05
							prefix = "   SUBSTANCE OF: ";
							break;
						case ISPARTPTR: // TDMS 26/8/05
							prefix = "   PART OF: ";
							break;
						default:
							prefix = "=> ";
							break;
					}

					/* Read synset pointed to */
					cursyn = new SynSet(pt.off, pt.pos, this);
					search.wordsFrom(cursyn);

					// TDMS 6 Oct 2005 - build hierarchical results

					if (this.senses == null)
						this.senses = new SynSetList();
					cursyn.thisptr = pt;  // TDMS 17 Nov 2005 - add this pointer type
					this.senses.Add(cursyn);

					/* For Pertainyms and Participles pointing to a specific
					   sense, indicate the sense then retrieve the synset
					   pointed to and other info as determined by type.
					   Otherwise, just print the synset pointed to. */
					if ((ptp.ident == PERTPTR || ptp.ident == PPLPTR) &&
						pt.dst != 0)
					{
						string tbuf = " (Sense " + cursyn.getsearchsense(pt.dst) + ")";
						cursyn.str(prefix, tbuf, 0, pt.dst, 0, 1);
						if (ptp.ident == PPLPTR) // adj pointing to verb
						{
							cursyn.str("     =>", "\n", 1, 0, 1, 1);
							cursyn.tracePtrs(PointerType.of("HYPERPTR"), cursyn.pos, 0);
						}
						else if (fpos.name == "adv") // adverb pointing to adjective
						{
							cursyn.str("     =>", "\n", 0, 0, (pos.clss == "SATELLITE") ? 0 : 1, 1);
							// cursyn.traceptrs(HYPERPTR,pos,0);
						}
						else  // adjective pointing to noun
						{
							cursyn.str("     =>", "\n", 1, 0, 1, 1);
							cursyn.tracePtrs(PointerType.of("HYPERPTR"), pos, 0);
						}
					}
					else
						cursyn.str(prefix, "\n", 1, 0, 1, 1);
					/* For HOLONYMS and MERONYMS, keep track of last one
					   printed in buffer so results can be truncated later. */
					if (ptp.ident >= PointerType.of("ISMEMBERPTR").ident &&
						ptp.ident <= PointerType.of("HASPARTPTR").ident)
					{
						search.mark();
					}
					if (depth > 0)
					{
						depth = cursyn.depthcheck(depth);
						cursyn.tracePtrs(ptp, cursyn.pos, depth + 1);
					}
				}
			}
		}
예제 #38
0
		/// <summary>
		/// Trace coordinate terms.
		/// </summary>
		/// <param name="ptp"></param>
		/// <param name="fpos"></param>
		/// <param name="depth"></param>
		internal void traceCoords(PointerType ptp, PartOfSpeech fpos, int depth)
		{
			for (int i = 0; i < ptrs.Length; i++)
			{
				Pointer pt = ptrs[i];
				/* WN2.0
								if (pt.ptp.mnemonic=="HYPERPTR" &&
									(pt.sce==0 ||
									 pt.sce==whichword))
				*/
				// WN2.1 if statement change - TDMS
				if ((pt.ptp.ident == HYPERPTR || pt.ptp.ident == INSTANCE) &&
					((pt.sce == 0) ||
					(pt.sce == whichword)))
				{
					if (!search.prflag)
					{
						strsns(sense + 1);
						search.prflag = true;
					}
					spaces("TRACEC", depth);
					SynSet cursyn = new SynSet(pt.off, pt.pos, this);
					search.wordsFrom(cursyn);
					cursyn.str("-> ", "\n", 1, 0, 0, 1);
					cursyn.tracePtrs(ptp, cursyn.pos, depth);
					// TDMS 6 Oct 2005 - build hierarchical results
					if (this.senses == null)
						this.senses = new SynSetList();
					cursyn.thisptr = pt;  // TDMS 17 Nov 2005 - add this pointer type
					this.senses.Add(cursyn);

					if (depth > 0)
					{
						depth = depthcheck(depth);
						cursyn.traceCoords(ptp, cursyn.pos, depth + 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
						this.senses.Add(cursyn);
					}
				}
			}
		}
예제 #39
0
파일: util.cs 프로젝트: cuiwanyun/KBQA
 public static string binSearch(string word,PartOfSpeech pos)
 {
     return binSearch(word,WNDB.index(pos));
 }
예제 #40
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();
		}
예제 #41
0
파일: util.cs 프로젝트: cuiwanyun/KBQA
 public static void reopen(PartOfSpeech p)
 {
     WNDBpart w = WNDBpart.of(p);
     w.index.Close();
     w.data.Close();
     w.index = new StreamReader(IndexFile(p));
     w.data = new StreamReader(DataFile(p));
 }
예제 #42
0
		internal static ArrayList wngrep(string wordPassed, PartOfSpeech pos)
		{
			ArrayList r = new ArrayList();
			StreamReader fp = index(pos);
			fp.BaseStream.Position = 0;
			fp.DiscardBufferedData();
			string word = wordPassed.Replace(" ", "_");
			string line;

			while ((line = fp.ReadLine()) != null)
			{
				int lineLen = line.IndexOf(' ');
				line = line.Substring(0, lineLen);
				try
				{
					if (line.IndexOf(word) >= 0)
						r.Add(line.Replace("_", " "));
				}
				catch
				{
				}
			}
			return r;
		}
예제 #43
0
파일: util.cs 프로젝트: cuiwanyun/KBQA
 public static WNDBpart of(PartOfSpeech p)
 {
     return (WNDBpart)fps[p];
 }
예제 #44
0
		public Search(string w, bool doMorphs, PartOfSpeech p, SearchType s, int sn)
			: this(w, p, s, sn)
		{
			if (p != null)
				do_search(doMorphs);
		}
예제 #45
0
파일: util.cs 프로젝트: cuiwanyun/KBQA
        internal static ArrayList wngrep(string wordPassed,PartOfSpeech pos)
        {
            ArrayList r = new ArrayList();
            MemoryStream ms = index(pos);
            StreamReader inputFile = new StreamReader(ms); //= index(pos);
            inputFile.BaseStream.Seek(0L,SeekOrigin.Begin);
            inputFile.DiscardBufferedData();
            string word = wordPassed.Replace(" ","_");
            string line;

            while ((line=inputFile.ReadLine())!=null)
            {
                int lineLen = line.IndexOf(' ');
                line = line.Substring(0,lineLen);
                try
                {
                    if (line.IndexOf(word)>=0)
                        r.Add(line.Replace("_"," "));
                }
                catch
                {
                }
            }
            return r;
        }
예제 #46
0
파일: util.cs 프로젝트: cuiwanyun/KBQA
 internal static string ExcFile(PartOfSpeech n)
 {
     return path+n.name+".exc";
 }
예제 #47
0
		public static StreamReader index(PartOfSpeech p)
		{
			return (StreamReader)indexfps[p.key];
		}
예제 #48
0
		public static StreamReader data(PartOfSpeech p)
		{
			return (StreamReader)datafps[p.key];
		}
예제 #49
0
		public static void reopen(PartOfSpeech p)
		{
			index(p).Close();
			data(p).Close();
			indexfps[p.key] = GetStreamReader(IndexFile(p));
			datafps[p.key] = GetStreamReader(DataFile(p));
		}
예제 #50
0
파일: util.cs 프로젝트: cuiwanyun/KBQA
        Index[] offsets = new Index[stringscount]; // of Index

        #endregion Fields

        #region Constructors

        public Indexes(string str,PartOfSpeech pos)
        {
            string[] strings = new string[stringscount];
            str = str.ToLower();
            strings[0] = str;
            strings[1] = str.Replace('_','-');
            strings[2] = str.Replace('-','_');
            strings[3] = str.Replace("-","").Replace("_","");
            strings[4] = str.Replace(".","");
            // TDMS - 14 Aug 2005 - added two more possibilities
            // to allow for spaces to be transformed
            // an example is a search for "11 plus", without this
            // transformation no result would be found
            strings[5] = str.Replace(' ','-');
            strings[6] = str.Replace(' ','_');
            offsets[0] = Index.lookup(str,pos);
            // TDMS - 14 Aug 2005 - changed 5 to 7 to allow for two
            // new possibilities
            for (int i=1;i<stringscount;i++)
                if (str!=strings[i])
                    offsets[i] = Index.lookup(strings[i],pos);
            fpos = pos;
        }
예제 #51
0
파일: util.cs 프로젝트: cuiwanyun/KBQA
 Opt(string a,string m,string p,int h,string b)
 {
     arg = a;
     if (m[0]=='-')
         sch = new SearchType(true,m.Substring(1));
     else
         sch = new SearchType(false,m);
     pos = PartOfSpeech.of(p.ToLower());
     helpx = h;
     label = b;
     id = opts.Count;
     opts.Add(this);
 }
예제 #52
0
파일: util.cs 프로젝트: cuiwanyun/KBQA
 internal static string DataFile(PartOfSpeech n)
 {
     return path+"data."+n.name; // WN2.1 - TDMS
 }
예제 #53
0
		public WNHelp(SearchType s, PartOfSpeech p)
			: this((s.rec ? "-" : "") + s.ptp.mnemonic, p)
		{
		}
예제 #54
0
파일: util.cs 프로젝트: cuiwanyun/KBQA
        // TDMS 16 July 2006 - removed this method.
        // Method removed because if called externally
        // WNDBPart was not correctly constructed.
        // Calling is_defined(string searchstr,PartOfSpeech fpos)
        // correctly constructs WNDBPart.
        /*
        private static SearchSet is_defined(string word,string p)
        {
            Console.WriteLine("is_defined string, string");
            return is_defined(word,PartOfSpeech.of(p));
        }
        */
        /// <summary>
        /// Determines if a word is defined in the WordNet database and returns
        /// all possible searches of the word.
        /// </summary>
        /// <example> This sample displays a message stating whether the 
        /// word "car" exists as the part of speech "noun".
        /// <code>
        /// Wnlib.WNCommon.path = "C:\Program Files\WordNet\2.1\dict\"
        /// Dim wrd As String = "car"
        /// Dim POS As String = "noun"
        /// Dim b As Boolean = Wnlib.WNDB.is_defined(wrd, Wnlib.PartOfSpeech.of(POS)).NonEmpty.ToString
        /// 
        /// If b Then
        /// 	MessageBox.Show("The word " & wrd & " exists as a " & POS & ".")
        /// Else
        /// 	MessageBox.Show("The word " & wrd & " does not exist as a " & POS & ".")
        /// End If
        /// </code>
        /// </example>
        /// <param name="searchstr">The word to search for</param>
        /// <param name="fpos">Part of Speech (noun, verb, adjective, adverb)</param>
        /// <returns>A SearchSet or null if the word does not exist in the dictionary</returns>
        public static SearchSet is_defined(string searchstr,PartOfSpeech fpos)
        {
            Indexes ixs = new Indexes(searchstr,fpos);
            Index index;
            int i;
            int CLASS =          22;	/* - */
            int LASTTYPE =	CLASS;

            Search s = new Search(searchstr,fpos,new SearchType(false,"FREQ"),0);
            SearchSet retval = new SearchSet();
            while ((index=ixs.next())!=null)
            {
                retval=retval+"SIMPTR"+"FREQ"+"SYNS"+"WNGREP"+"OVERVIEW"; // added WNGREP - TDMS
                for (i=0;i<index.ptruse.Length;i++)
                {
                    PointerType pt = index.ptruse[i];
            //					retval=retval+pt;

                    // WN2.1 - TDMS
                    if (pt.ident <= LASTTYPE) {
                        retval = retval + pt;
                    } else if (pt.mnemonic == "INSTANCE") {
                        retval = retval + "HYPERPTR";
                    } else if (pt.mnemonic == "INSTANCES") {
                        retval = retval + "HYPOPTR";
                    }

                    // WN2.1 - TDMS
                    if (pt.mnemonic == "SIMPTR") {
                        retval = retval + "ANTPTR";
                    }

                    if (fpos.name=="noun")
                    {
                        /* set generic HOLONYM and/or MERONYM bit if necessary */
                        if (pt>="ISMEMBERPTR" && pt<="ISPARTPTR")
                            retval=retval+"HOLONYM";
                        else if (pt>="HASMEMBERPTR" && pt<="HASPARTPTR")
                            retval=retval+"MERONYM";
                    }
            // WN2.1 - TDMS					else if (fpos.name=="adj" && pt.mnemonic=="SIMPTR")
            //						retval=retval+"ANTPTR";
                }
                if (fpos.name=="noun")
                {
                    retval=retval+"RELATIVES";
                    if (index.HasHoloMero("HMERONYM",s))
                        retval=retval+"HMERONYM";
                    if (index.HasHoloMero("HHOLONYM",s))
                        retval=retval+"HHOLONYM";
                    if (retval["HYPERPTR"])
                        retval = retval+"COORDS";
                }
                else if (fpos.name=="verb")
                    retval=retval+"RELATIVES"+"FRAMES"; // added frames - TDMS
            }
            return retval;
        }
예제 #55
0
파일: util.cs 프로젝트: cuiwanyun/KBQA
 public WNDBpart(PartOfSpeech p)
 {
     try
     {
         Console.WriteLine("WNDBpart");
         index = new StreamReader(WNDB.IndexFile(p));
         data = new StreamReader(WNDB.DataFile(p));
         fps[p] = this;
     }
     catch
     {
         MessageBox.Show("Bad dict path");
         // TODO: handle bad dict path
         // ignore errors - as the user is locating the dictionary location
         // wordnet classes are trying to instantiate based on an incorrect dict path
     }
 }
예제 #56
0
		internal void strAnt(PartOfSpeech pos, int wdnum, string head, string tail)
		{
			int i, j, wdoff;

			/* Go through all the pointers looking for anotnyms from the word
			   indicated by wdnum.  When found, print all the antonym's
			   antonym pointers which point back to wdnum. */
			for (i = 0; i < ptrs.Length; i++)
			{
				Pointer pt = ptrs[i];
				if (pt.ptp.ident == ANTPTR && pt.sce == wdnum)
				{
					SynSet psyn = new SynSet(pt.off, pos, this);
					for (j = 0; j < psyn.ptrs.Length; j++)
					{
						Pointer ppt = psyn.ptrs[j];
						if (ppt.ptp.ident == ANTPTR &&
							ppt.dst == wdnum &&
							ppt.off == hereiam)
						{
							wdoff = ppt.sce > 0 ? ppt.sce - 1 : 0;
							search.buf += head;
							/* Construct buffer containing formatted antonym,
							   then add it onto end of return buffer */
							search.buf += deadjify(psyn.words[wdoff].word);
							/* Print additional lexicographer information and
							   WordNet sense number as indicated by flags */
							isDirty = true; // TDMS 19 July 2006 - attempt to tie the logic which 
							// populates buf to the logic that defines whether the 
							// synset is populated with relevant information

							if (search.prlexid && psyn.words[wdoff].uniq != 0)
								search.buf += psyn.words[wdoff].uniq;
							int s = getsearchsense(wdoff + 1);
							psyn.words[wdoff].wnsns = s;
							if (WNOpt.opt("-s").flag)
							{
								search.buf += "#" + s;
								isDirty = true; // TDMS 19 July 2006 - attempt to tie the logic which 
								// populates buf to the logic that defines whether the 
								// synset is populated with relevant information
							}
							search.buf += tail;
						}
					}
				}
			}
		}
예제 #57
0
		public WNHelp(string s, PartOfSpeech p)
		{
			help = (string)p.help[s];
		}
예제 #58
0
파일: util.cs 프로젝트: cuiwanyun/KBQA
 //StreamReader index(PartOfSpeech p)
 public static MemoryStream index(PartOfSpeech p)
 {
     if(laststr == ((System.IO.FileStream)(WNDBpart.of(p).index.BaseStream)).Name)
     {
         return ms; //WNDBpart.of(p).index;
     }
     else
     {
         laststr = ((System.IO.FileStream)(WNDBpart.of(p).index.BaseStream)).Name;
         StreamReader fs = WNDBpart.of(p).index;
         fs.BaseStream.Position = 0;
         Byte[] b = System.Text.Encoding.Unicode.GetBytes(fs.ReadToEnd());
         ms = new MemoryStream(b);
         return ms; //WNDBpart.of(p).index;
     }
 }
예제 #59
0
파일: util.cs 프로젝트: cuiwanyun/KBQA
 public static StreamReader data(PartOfSpeech p)
 {
     return WNDBpart.of(p).data;
 }
예제 #60
0
파일: util.cs 프로젝트: cuiwanyun/KBQA
 internal static string IndexFile(PartOfSpeech n)
 {
     return path+"index."+n.name; // WN2.1 - TDMS
 }