Indentation
diff --git a/src/nlsr_tokenizer.cpp b/src/nlsr_tokenizer.cpp
index cf655ba..3c49f8c 100644
--- a/src/nlsr_tokenizer.cpp
+++ b/src/nlsr_tokenizer.cpp
@@ -6,115 +6,134 @@
#include "nlsr_tokenizer.hpp"
-namespace nlsr {
+namespace nlsr
+{
-using namespace std;
-using namespace boost;
+ using namespace std;
+ using namespace boost;
-void
-nlsrTokenizer::makeToken(){
- char_separator<char> sep(seps.c_str());
- tokenizer< char_separator<char> >tokens(originalString, sep);
- tokenizer< char_separator<char> >::iterator tok_iter = tokens.begin();
-
- string ft(*tok_iter);
- firstToken=ft;
- ++tok_iter;
+ void
+ nlsrTokenizer::makeToken()
+ {
+ char_separator<char> sep(seps.c_str());
+ tokenizer< char_separator<char> >tokens(originalString, sep);
+ tokenizer< char_separator<char> >::iterator tok_iter = tokens.begin();
- for ( ;tok_iter != tokens.end(); ++tok_iter){
- string oneToken(*tok_iter);
- this->insertToken(oneToken);
- restOfTheLine+=oneToken;
- restOfTheLine+=seps;
- }
+ string ft(*tok_iter);
+ firstToken=ft;
+ ++tok_iter;
- trim(restOfTheLine);
-}
+ for ( ; tok_iter != tokens.end(); ++tok_iter)
+ {
+ string oneToken(*tok_iter);
+ this->insertToken(oneToken);
+ restOfTheLine+=oneToken;
+ restOfTheLine+=seps;
+ }
-void
-nlsrTokenizer::insertToken(const string& token){
- tokenList.push_back(token);
-}
+ trim(restOfTheLine);
+ }
-int
-nlsrTokenizer::getTokenPosition(string& token){
- int pos=-1;
- int i=1;
+ void
+ nlsrTokenizer::insertToken(const string& token)
+ {
+ tokenList.push_back(token);
+ }
- for(std::list<string>::iterator it=tokenList.begin();it!=tokenList.end();it++){
- if( (*it) == token ){
- break;
- }
- i++;
- }
+ int
+ nlsrTokenizer::getTokenPosition(string& token)
+ {
+ int pos=-1;
+ int i=1;
- if( i < tokenList.size() ){
- pos=i;
- }
+ for(std::list<string>::iterator it=tokenList.begin(); it!=tokenList.end(); it++)
+ {
+ if( (*it) == token )
+ {
+ break;
+ }
+ i++;
+ }
- return pos;
-}
+ if( i < tokenList.size() )
+ {
+ pos=i;
+ }
-string
-nlsrTokenizer::getTokenString(int from , int to){
- string returnString;
- if ( from >=0 && to < tokenList.size()){
- int i=0;
- for(std::list<string>::iterator it=tokenList.begin();
- it!=tokenList.end();it++){
- i++;
- if( i >= from && i<= to ){
- string oneToken((*it));
- returnString+=seps;
- returnString+=oneToken;
-
- }
-
- }
- }
+ return pos;
+ }
- trim(returnString);
- return returnString;
-}
+ string
+ nlsrTokenizer::getTokenString(int from , int to)
+ {
+ string returnString;
+ if ( from >=0 && to < tokenList.size())
+ {
+ int i=0;
+ for(std::list<string>::iterator it=tokenList.begin();
+ it!=tokenList.end(); it++)
+ {
+ i++;
+ if( i >= from && i<= to )
+ {
+ string oneToken((*it));
+ returnString+=seps;
+ returnString+=oneToken;
-string
-nlsrTokenizer::getTokenString(int from){
- string returnString;
- if ( from >=0 && from < tokenList.size()){
- int i=0;
- for(std::list<string>::iterator it=tokenList.begin();
- it!=tokenList.end();it++){
- i++;
- if( i >= from){
- string oneToken((*it));
- returnString+=seps;
- returnString+=oneToken;
-
- }
-
- }
- }
+ }
- trim(returnString);
- return returnString;
-}
+ }
+ }
-static bool
-tokenCompare(string& s1, string& s2){
- return s1==s2;
-}
+ trim(returnString);
+ return returnString;
+ }
-bool
-nlsrTokenizer::doesTokenExist(string token){
- std::list<string >::iterator it = std::find_if( tokenList.begin(),
- tokenList.end(),
- bind(&tokenCompare, _1 , token));
+ string
+ nlsrTokenizer::getTokenString(int from)
+ {
+ string returnString;
+ if ( from >=0 && from < tokenList.size())
+ {
+ int i=0;
+ for(std::list<string>::iterator it=tokenList.begin();
+ it!=tokenList.end(); it++)
+ {
+ i++;
+ if( i >= from)
+ {
+ string oneToken((*it));
+ returnString+=seps;
+ returnString+=oneToken;
- if( it != tokenList.end() ){
- return true;
- }
+ }
- return false;
-}
+ }
+ }
+
+ trim(returnString);
+ return returnString;
+ }
+
+ static bool
+ tokenCompare(string& s1, string& s2)
+ {
+ return s1==s2;
+ }
+
+ bool
+ nlsrTokenizer::doesTokenExist(string token)
+ {
+ std::list<string >::iterator it = std::find_if( tokenList.begin(),
+ tokenList.end(),
+ bind(&tokenCompare, _1 , token));
+
+ if( it != tokenList.end() )
+ {
+ return true;
+ }
+
+ return false;
+ }
}//namespace nlsr