Mercurial Hosting > luan
comparison src/goodjava/lucene/queryparser/GoodQueryParser.java @ 1622:b7f8418fb7ba
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 26 Jul 2021 11:51:56 -0600 |
parents | a9591906e608 |
children | d1e7564a9ce5 |
comparison
equal
deleted
inserted
replaced
1621:a9591906e608 | 1622:b7f8418fb7ba |
---|---|
15 | 15 |
16 public class GoodQueryParser { | 16 public class GoodQueryParser { |
17 | 17 |
18 public static Query parseQuery(FieldParser fieldParser,String query) throws ParseException { | 18 public static Query parseQuery(FieldParser fieldParser,String query) throws ParseException { |
19 return new GoodQueryParser(fieldParser,query).parseQuery(); | 19 return new GoodQueryParser(fieldParser,query).parseQuery(); |
20 } | |
21 | |
22 public static String quote(String s) { | |
23 s = s.replace("\\","\\\\"); | |
24 s = s.replace("\b","\\b"); | |
25 s = s.replace("\f","\\f"); | |
26 s = s.replace("\n","\\n"); | |
27 s = s.replace("\r","\\r"); | |
28 s = s.replace("\t","\\t"); | |
29 s = s.replace("\"","\\\""); | |
30 return '"'+s+'"'; | |
20 } | 31 } |
21 | 32 |
22 public static String escape(String s) { | 33 public static String escape(String s) { |
23 s = s.replace("\\","\\\\"); | 34 s = s.replace("\\","\\\\"); |
24 s = s.replace("\b","\\b"); | 35 s = s.replace("\b","\\b"); |