Skip to content

Commit

Permalink
Moves a comment to a better place in example app
Browse files Browse the repository at this point in the history
  • Loading branch information
dylon committed Feb 14, 2024
1 parent f81eab9 commit 70bac33
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions example/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ void query(ll::Dawg *dawg, const std::string &query_term, std::size_t max_distan
std::cout << "d(\"" << query_term << "\", \"" << term << "\") = "
<< distance << std::endl;
}

/**
* NOTE: If you had initialized the transducer as
*
* ll::Transducer<Type, std::string> transduce(dawg->root());
*
* , you would iterate over the results as follows:
*
* for (const std::string& term : transduce(query_term, max_distance)) {
* // do something with term, which is guaranteed to require no more
* // than max_distance operations to transform it into the query_term.
* }
*/
}

std::string &prompt(std::string &query_term) {
Expand Down Expand Up @@ -99,16 +112,6 @@ auto main(int argc, char *argv[]) -> int {
std::cout << std::endl;
std::cout << "Exiting ..." << std::endl;

/**
* If you had initialized the transducer as
* ll::Transducer<ll::Algorithm::TRANSPOSITION, std::string>, you'd iterate
* over the results as follows:
* for (const std::string& term : transduce(query_term, max_distance)) {
* // do something with term, which is guaranteed to require no more
* // than max_distance operations to transform it into the query_term.
* }
*/

// save the dictionary for reuse
serialize_protobuf(dawg, cli.serialization_path());

Expand Down

0 comments on commit 70bac33

Please sign in to comment.