updated tutorial

This commit is contained in:
rjawor 2015-08-24 14:30:20 +02:00
parent 0a3fd8a04e
commit bd62420cd5
2 changed files with 4 additions and 4 deletions

View File

@ -118,9 +118,9 @@ using namespace std;
int main() { int main() {
Concordia concordia(EXAMPLES_DIR"/../tests/resources/concordia-config/concordia.cfg"); Concordia concordia(EXAMPLES_DIR"/../tests/resources/concordia-config/concordia.cfg");
boost::shared_ptr<TokenizedSentence> ts = concordia.addExample(Example("Alice has a cat", 56)); TokenizedSentence ts = concordia.addExample(Example("Alice has a cat", 56));
cout << "Added the following tokens: " << endl; cout << "Added the following tokens: " << endl;
BOOST_FOREACH(TokenAnnotation token, ts->getTokens()) { BOOST_FOREACH(TokenAnnotation token, ts.getTokens()) {
cout << "\"" << token.getValue() << "\"" << " at positions: [" << token.getStart() << "," cout << "\"" << token.getValue() << "\"" << " at positions: [" << token.getStart() << ","
<< token.getEnd() << ")" << endl; << token.getEnd() << ")" << endl;
} }

View File

@ -14,9 +14,9 @@ using namespace std;
int main() { int main() {
Concordia concordia(EXAMPLES_DIR"/../tests/resources/concordia-config/concordia.cfg"); Concordia concordia(EXAMPLES_DIR"/../tests/resources/concordia-config/concordia.cfg");
boost::shared_ptr<TokenizedSentence> ts = concordia.addExample(Example("Alice has a cat", 56)); TokenizedSentence ts = concordia.addExample(Example("Alice has a cat", 56));
cout << "Added the following tokens: " << endl; cout << "Added the following tokens: " << endl;
BOOST_FOREACH(TokenAnnotation token, ts->getTokens()) { BOOST_FOREACH(TokenAnnotation token, ts.getTokens()) {
cout << "\"" << token.getValue() << "\"" << " at positions: [" << token.getStart() << "," cout << "\"" << token.getValue() << "\"" << " at positions: [" << token.getStart() << ","
<< token.getEnd() << ")" << endl; << token.getEnd() << ")" << endl;
} }