summaryrefslogtreecommitdiff
path: root/src/util/didyoumean.cpp
diff options
context:
space:
mode:
authorKshitij Bansal <kshitij@cs.nyu.edu>2014-04-28 18:18:24 -0400
committerKshitij Bansal <kshitij@cs.nyu.edu>2014-04-28 18:35:21 -0400
commit64093dc2f6f7d8af3dea84f0a1a230297620d4d1 (patch)
treec76922b46f17a5f9a5f944f1798c104c13c8f9e4 /src/util/didyoumean.cpp
parent004678b6386e66cfa6a079215a3644efca59cdf7 (diff)
cleanup
Diffstat (limited to 'src/util/didyoumean.cpp')
-rw-r--r--src/util/didyoumean.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/util/didyoumean.cpp b/src/util/didyoumean.cpp
index d64435ce7..228fe721e 100644
--- a/src/util/didyoumean.cpp
+++ b/src/util/didyoumean.cpp
@@ -14,15 +14,14 @@
** ``What do you mean? I don't understand.'' An attempt to be more
** helpful than that. Similar to one in git.
**
- ** There are no dependencies on CVC4, intentionally.
+ ** There are no dependencies on CVC4 (except namespace).
**/
#include "didyoumean.h"
#include <iostream>
#include <sstream>
-#include <boost/foreach.hpp>
-#include <boost/algorithm/string/predicate.hpp>
using namespace std;
+using namespace CVC4;
vector<string> DidYouMean::getMatch(string input) {
/** Magic numbers */
@@ -31,14 +30,15 @@ vector<string> DidYouMean::getMatch(string input) {
set< pair<int, string> > scores;
vector<string> ret;
- BOOST_FOREACH(string s, d_words ) {
+ for(typeof(d_words.begin()) it = d_words.begin(); it != d_words.end(); ++it) {
+ string s = (*it);
if( s == input ) {
// if input matches AS-IS just return that
ret.push_back(s);
return ret;
}
int score;
- if(boost::starts_with(s, input)) {
+ if(s.compare(0, input.size(), input) == 0) {
score = 0;
} else {
score = editDistance(input, s) + 1;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback