Parse Analysis and Generation of Turkish Words  v1.0
Gram tests on Turkish word morphology and generating words from parsed words using foma and TRmorph.
/home/emre/Desktop/nlp/hw01/ngram.hpp
Go to the documentation of this file.
00001 
00013 #ifndef NGRAM_H
00014 #define NGRAM_H
00015 
00016 #include <cstdio>
00017 #include <iostream>
00018 #include <cstdlib>
00019 #include <vector>
00020 #include <string>
00021 #include <queue>
00022 
00023 class NGram
00024 {
00025         private :
00026                 std::vector<std::deque<std::string> > gram;
00027                 std::vector<int> counter;
00028                 std::vector<std::vector<std::string> > wordList;
00029                 unsigned int printSize;
00030                 
00031                 int contains(std::deque<std::string> queue);
00032                 void increaseCounter(int index);
00033                 
00034                 void add(std::deque<std::string> queue, std::string root);
00035 
00036                 void addRoot(int index, std::string root);
00037                 
00038         public :
00039                 NGram();
00040                 void setPrintSize(unsigned int n);
00041                 void sort();
00042                 void printRoot(int index);
00043                 std::vector<std::string> selectRoot(int selectTopNumber);
00044                 std::vector<std::string> selectAppendix(std::string rootPart, int selectFromTop);
00045                 int checkItOut(std::deque<std::string> queue, std::string root);
00046                 friend std::ostream& operator<<(std::ostream& os, const NGram& gr);
00047 };
00048 
00049 #endif
 All Classes Files Functions Friends