Skip to content

Commit 45a4de1

Browse files
committed
1 parent e5b37f1 commit 45a4de1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/edu/stanford/nlp/util/GoogleNGramsSQLBacked.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ public static List<Pair<String, Long>> getCounts(Collection<String> strs) throws
118118
String query = "";
119119
for(String str: strs) {
120120
str = str.trim();
121+
if(str.contains("'")){
122+
str = StringUtils.escapeString(str, new char[]{'\''},'\'');
123+
}
121124
int ngram = str.split("\\s+").length;
122125
String table = tablenamePrefix + ngram;
123126
if (!existsTable(table)){

0 commit comments

Comments
 (0)