From b73535bf6a392e894d914b17fa9df8bada0a8d14 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 19 Jul 2015 22:44:17 -0400 Subject: Stopped using C++11 because yamlcpp didn't like it --- Makefile.am | 3 +-- kgramstats.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index 150ede2..299dc10 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,6 +4,5 @@ ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} bin_PROGRAMS = rawr-ebooks rawr-gen rawr_ebooks_SOURCES = ebooks.cpp kgramstats.cpp freevars.cpp rawr_gen_SOURCES = gen.cpp kgramstats.cpp freevars.cpp -rawr_gen_CPPFLAGS = -std=c++11 -rawr_ebooks_CPPFLAGS = $(LIBTWITCURL_CFLAGS) $(YAML_CFLAGS) -std=c++11 +rawr_ebooks_CPPFLAGS = $(LIBTWITCURL_CFLAGS) $(YAML_CFLAGS) rawr_ebooks_LDADD = $(LIBTWITCURL_LIBS) $(YAML_LIBS) \ No newline at end of file diff --git a/kgramstats.cpp b/kgramstats.cpp index 1f3dd3c..648a267 100644 --- a/kgramstats.cpp +++ b/kgramstats.cpp @@ -299,15 +299,18 @@ vector kgramstats::randomSentence(int n) return result; } +bool removeIf(char c) +{ + return !((c != '.') && (c != '"') && (c != '(') && (c != ')') && (c != ',')); +} + std::string canonize(std::string f) { string canonical(f); transform(canonical.begin(), canonical.end(), canonical.begin(), ::tolower); string result; - remove_copy_if(canonical.begin(), canonical.end(), std::back_inserter(result), [] (char c) { - return !((c != '.') && (c != '"') && (c != '(') && (c != ')') && (c != ',')); - }); + remove_copy_if(canonical.begin(), canonical.end(), std::back_inserter(result), removeIf); return result; } \ No newline at end of file -- cgit 1.4.1