np.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00028
00029 #ifndef _NP
00030 #define _NP
00031
00032 #include <set>
00033 #include <map>
00034
00035 #include "fries/language.h"
00036 #include "freeling/automat.h"
00037 #include "freeling/ner.h"
00038 #include "regexp-pcre++.h"
00039
00040 #define RE_NA "^(NC|AQ)"
00041 #define RE_DNP "^[FWZ]"
00042 #define RE_CLO "^[DSC]"
00043
00047
00048 class np: public ner, public automat {
00049
00050 private:
00052 std::set<std::string> func;
00054 std::set<std::string> punct;
00056 std::set<std::string> names;
00058 std::map<std::string,int> ignore_tags;
00059 std::map<std::string,int> ignore_words;
00060
00062 bool initialNoun;
00063
00064 RegEx RE_NounAdj;
00065 RegEx RE_Closed;
00066 RegEx RE_DateNumPunct;
00067
00068 int ComputeToken(int,sentence::iterator &, sentence &);
00069 void ResetActions();
00070 void StateActions(int, int, int, sentence::const_iterator);
00071 void SetMultiwordAnalysis(sentence::iterator, int);
00072 bool ValidMultiWord(const word &);
00073 sentence::iterator BuildMultiword(sentence &, sentence::iterator,sentence::iterator, int, bool &);
00074 public:
00076 np(const std::string &);
00078 void annotate(sentence &);
00079
00080
00081 };
00082
00083 #endif