commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ki...@apache.org
Subject [01/13] [text] Make parse method public
Date Mon, 20 Apr 2015 02:58:58 GMT
Repository: commons-text
Updated Branches:
  refs/heads/master e8e85d9de -> bf8bfb0a4


Make parse method public


Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/aa293500
Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/aa293500
Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/aa293500

Branch: refs/heads/master
Commit: aa293500080d6872b3ac653dcf74a50cf8223ae5
Parents: e8e85d9
Author: Benedikt Ritter <britter@apache.org>
Authored: Sun Apr 19 15:58:16 2015 +0200
Committer: Benedikt Ritter <britter@apache.org>
Committed: Sun Apr 19 15:58:16 2015 +0200

----------------------------------------------------------------------
 src/main/java/org/apache/commons/text/names/HumanNameParser.java | 4 +---
 .../java/org/apache/commons/text/names/HumanNameParserTest.java  | 1 +
 2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-text/blob/aa293500/src/main/java/org/apache/commons/text/names/HumanNameParser.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/names/HumanNameParser.java b/src/main/java/org/apache/commons/text/names/HumanNameParser.java
index 843685a..5088bba 100644
--- a/src/main/java/org/apache/commons/text/names/HumanNameParser.java
+++ b/src/main/java/org/apache/commons/text/names/HumanNameParser.java
@@ -134,8 +134,6 @@ public class HumanNameParser {
                     "de la", "de", "del", "der", "di", "ibn", "la", "le",
                     "san", "st", "ste", "van", "van der", "van den", "vel",
                     "von" });
-
-        this.parse();
     }
 
     /**
@@ -224,7 +222,7 @@ public class HumanNameParser {
      *
      * @throws NameParseException if the parser fails to retrieve the name parts
      */
-    private void parse() {
+    public void parse() {
         String suffixes = StringUtils.join(this.suffixes, "\\.*|") + "\\.*";
         String prefixes = StringUtils.join(this.prefixes, " |") + " ";
 

http://git-wip-us.apache.org/repos/asf/commons-text/blob/aa293500/src/test/java/org/apache/commons/text/names/HumanNameParserTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/text/names/HumanNameParserTest.java b/src/test/java/org/apache/commons/text/names/HumanNameParserTest.java
index 90e1dfa..5ff7805 100644
--- a/src/test/java/org/apache/commons/text/names/HumanNameParserTest.java
+++ b/src/test/java/org/apache/commons/text/names/HumanNameParserTest.java
@@ -65,6 +65,7 @@ public class HumanNameParserTest {
      */
     private void validateRecord(CSVRecord record) {
         HumanNameParser parser = new HumanNameParser(record.get(Colums.Name));
+        parser.parse();
 
         long recordNum = record.getRecordNumber();
         assertThat("Wrong LeadingInit in record " + recordNum,


Mime
View raw message