|
@@ -4,8 +4,26 @@ import java.util.regex.Pattern;
|
4
|
4
|
public class HamletRegex {
|
5
|
5
|
Pattern horatioPat = Pattern.compile("HORATIO", Pattern.CASE_INSENSITIVE);
|
6
|
6
|
Pattern hamletPat = Pattern.compile("HAMLET", Pattern.CASE_INSENSITIVE);
|
|
7
|
+ String completelyReplaced;
|
7
|
8
|
|
8
|
9
|
|
|
10
|
+ public static void main(String[] args) {
|
|
11
|
+ HamletParser hamletParser = new HamletParser();
|
|
12
|
+ HamletRegex ham = new HamletRegex(hamletParser.getHamletData());
|
|
13
|
+ System.out.println(ham.getComplete());
|
|
14
|
+ }
|
|
15
|
+
|
|
16
|
+ public String getComplete(){
|
|
17
|
+ return completelyReplaced;
|
|
18
|
+ }
|
|
19
|
+ public HamletRegex(String hamlet){
|
|
20
|
+ completelyReplaced= hamletToLeon(horatioToTariq(hamlet));
|
|
21
|
+ }
|
|
22
|
+
|
|
23
|
+ public HamletRegex(){
|
|
24
|
+
|
|
25
|
+ }
|
|
26
|
+
|
9
|
27
|
public String hamletToLeon(String hamlet){
|
10
|
28
|
|
11
|
29
|
return hamletToLeonLower(hamletToLeonUpper(hamlet));
|