summaryrefslogtreecommitdiff
path: root/extractor/data_array.h
diff options
context:
space:
mode:
authorPaul Baltescu <pauldb89@gmail.com>2013-02-14 23:17:15 +0000
committerPaul Baltescu <pauldb89@gmail.com>2013-02-14 23:17:15 +0000
commit9a026ba2db8fa7723374109e6a4a8dcaff8733cd (patch)
tree34a60703a53ada76e7213da5940e86d6f476f1e4 /extractor/data_array.h
parent252fb164c208ec8f3005f8a652eb3b48c0644e3d (diff)
Working version of the grammar extractor.
Diffstat (limited to 'extractor/data_array.h')
-rw-r--r--extractor/data_array.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/extractor/data_array.h b/extractor/data_array.h
index 19fbff88..7c120b3c 100644
--- a/extractor/data_array.h
+++ b/extractor/data_array.h
@@ -2,14 +2,13 @@
#define _DATA_ARRAY_H_
#include <string>
-#include <tr1/unordered_map>
+#include <unordered_map>
#include <vector>
#include <boost/filesystem.hpp>
namespace fs = boost::filesystem;
using namespace std;
-using namespace tr1;
enum Side {
SOURCE,
@@ -18,9 +17,9 @@ enum Side {
class DataArray {
public:
- static int END_OF_FILE;
+ static int NULL_WORD;
static int END_OF_LINE;
- static string END_OF_FILE_STR;
+ static string NULL_WORD_STR;
static string END_OF_LINE_STR;
DataArray(const string& filename);
@@ -33,6 +32,8 @@ class DataArray {
virtual int AtIndex(int index) const;
+ virtual string GetWordAtIndex(int index) const;
+
virtual int GetSize() const;
virtual int GetVocabularySize() const;
@@ -43,9 +44,12 @@ class DataArray {
virtual string GetWord(int word_id) const;
- int GetNumSentences() const;
+ virtual int GetNumSentences() const;
+
+ virtual int GetSentenceStart(int position) const;
- int GetSentenceStart(int position) const;
+ //TODO(pauldb): Add unit tests.
+ virtual int GetSentenceLength(int sentence_id) const;
virtual int GetSentenceId(int position) const;