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
00027 #ifndef Tanl_MorphSplitter_H
00028 #define Tanl_MorphSplitter_H
00029
00030
00031
00032
00033 #include <map>
00034 #include <iostream>
00035
00036
00037 #include "Corpus/Token.h"
00038 #include "IPipe.h"
00039 #include "config.h"
00040
00041 struct _object;
00042
00043 namespace Tanl {
00044
00049 struct MorphSplitter : public IPipe<std::vector<Token*>*, std::vector<Token*>*>,
00050 public virtual RefCountable
00051 {
00052 public:
00053 MorphSplitter();
00054 Enumerator<std::vector<Token*>*>* pipe(std::istream& = std::cin);
00055 Enumerator<std::vector<Token*>*>* pipe(Enumerator<std::vector<Token*>*>&);
00056
00057 # ifdef HAVE_PYTHON
00058
00062 Enumerator<std::vector<Token*>*>* pipe(struct _object* pit);
00063 # endif
00064
00065 static std::map<std::string, std::string> clitics;
00066
00067 static std::vector<Token*>* split(std::vector<Token*>* inSentence);
00068 };
00069
00073 struct MorphStream : public Enumerator<std::vector<Token*>*>
00074 {
00075 public:
00076 MorphStream(std::istream&);
00077 bool MoveNext();
00078 std::vector<Token*>* Current();
00079
00080 private:
00081 std::istream& is;
00082 std::vector<Token*> sentence;
00083 };
00084
00088 struct MorphPipe : public Enumerator<std::vector<Token*>*>
00089 {
00090 public:
00091 MorphPipe(Enumerator<std::vector<Token*>*>&);
00092 bool MoveNext();
00093 std::vector<Token*>* Current();
00094
00095 private:
00096 Enumerator<std::vector<Token*>*>& tve;
00097 };
00098
00099 }
00100
00101 #endif // Tanl_MorphSplitter_H