diff options
Diffstat (limited to 'scripts/training/phrase-extract.7/SymbolSequence.h')
-rw-r--r-- | scripts/training/phrase-extract.7/SymbolSequence.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/scripts/training/phrase-extract.7/SymbolSequence.h b/scripts/training/phrase-extract.7/SymbolSequence.h new file mode 100644 index 000000000..997c24205 --- /dev/null +++ b/scripts/training/phrase-extract.7/SymbolSequence.h @@ -0,0 +1,42 @@ +#pragma once +/* + * SymbolSequence.h + * extract + * + * Created by Hieu Hoang on 21/07/2010. + * Copyright 2010 __MyCompanyName__. All rights reserved. + * + */ +#include <iostream> +#include <vector> +#include "Symbol.h" + +class SymbolSequence +{ + friend std::ostream& operator<<(std::ostream &out, const SymbolSequence &obj); + +protected: + typedef std::vector<Symbol> CollType; + CollType m_coll; + +public: + typedef CollType::iterator iterator; + typedef CollType::const_iterator const_iterator; + const_iterator begin() const { return m_coll.begin(); } + const_iterator end() const { return m_coll.end(); } + + void Add(const Symbol &symbol) + { + m_coll.push_back(symbol); + } + size_t GetSize() const + { return m_coll.size(); } + const Symbol &GetSymbol(size_t ind) const + { return m_coll[ind]; } + + void Clear() + { m_coll.clear(); } + + int Compare(const SymbolSequence &other) const; + +}; |