diff options
| author | Paul Baltescu <pauldb89@gmail.com> | 2013-02-14 23:17:15 +0000 | 
|---|---|---|
| committer | Paul Baltescu <pauldb89@gmail.com> | 2013-02-14 23:17:15 +0000 | 
| commit | 63b30ed9c8510da8c8e2f6a456576424fddacc0e (patch) | |
| tree | 1b5278fb5a4480b7f7a965bb6de8f6f9e9c4d333 /extractor/data_array.h | |
| parent | 0a53f7eca74c165b5ce1c238f1999ddf1febea55 (diff) | |
Working version of the grammar extractor.
Diffstat (limited to 'extractor/data_array.h')
| -rw-r--r-- | extractor/data_array.h | 16 | 
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; | 
