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 #include "FeatureSpecs.h"
00026
00027
00028 #include <sstream>
00029
00030 using namespace std;
00031 using namespace IXE;
00032 using namespace Tanl::Text;
00033
00034 namespace Tanl {
00035 namespace NER {
00036
00037
00038
00039 conf_feature featureSpecs("Feature");
00040
00041 conf_feature morphFeatureSpecs("MorphFeature");
00042
00043 void conf_feature::parseValue(char const*& line)
00044 {
00045 char const* st = next_token_line(line, " \r\t");
00046 string const attribute(st, line - st);
00047 st = next_token_line(line, " \r\t");
00048 string const pattern(st, line - st);
00049 FeatureSpec* spec = new FeatureSpec(attribute, pattern, line);
00050 value.insert(spec);
00051 }
00052
00053 FeatureSpec::FeatureSpec(string const& name, string const& pattern, char const* list) :
00054 name(name),
00055 pattern(pattern)
00056 {
00057 stringstream ss(list);
00058 int n;
00059 while (ss >> n)
00060 tokens.push_back(n);
00061 }
00062
00063 std::ostream& operator <<(std::ostream& os, FeatureSpecs& specs) {
00064 return os;
00065 }
00066
00067 }
00068 }