|
@@ -49,11 +49,15 @@ public class HamletParser {
|
49
|
49
|
|
50
|
50
|
public boolean findHamlet() {
|
51
|
51
|
|
52
|
|
- return hamletData.toLowerCase().contains("hamlet");
|
|
52
|
+ Pattern pattern = Pattern.compile("hamlet", Pattern.CASE_INSENSITIVE);
|
|
53
|
+ Matcher matcher = pattern.matcher(hamletData);
|
|
54
|
+ return matcher.find();
|
53
|
55
|
}
|
54
|
56
|
|
55
|
57
|
public boolean findHoratio() {
|
56
|
|
- return hamletData.toLowerCase().contains("horatio");
|
|
58
|
+ Pattern pattern = Pattern.compile("horatio", Pattern.CASE_INSENSITIVE);
|
|
59
|
+ Matcher matcher = pattern.matcher(hamletData);
|
|
60
|
+ return matcher.find();
|
57
|
61
|
}
|
58
|
62
|
|
59
|
63
|
public void toTariq() {
|