nafis nibir 6 年前
父节点
当前提交
c33ad46fac
共有 1 个文件被更改,包括 18 次插入0 次删除
  1. 18
    0
      src/main/java/HamletRegex.java

+ 18
- 0
src/main/java/HamletRegex.java 查看文件

@@ -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));