cleanup
authorAndreas Müller <a.mueller@bgbm.org>
Wed, 7 Mar 2018 08:57:12 +0000 (09:57 +0100)
committerAndreas Müller <a.mueller@bgbm.org>
Wed, 7 Mar 2018 09:00:02 +0000 (10:00 +0100)
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/DefaultTermInitializer.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImplRegExBase.java
cdmlib-persistence/src/test/java/eu/etaxonomy/cdm/database/PersistentTermInitializerTest.java

index 86278e24e096b06c39570cb0e6808cd2bb853642..d5a91637c908c60446ed67052d4753056ca71124 100644 (file)
@@ -39,7 +39,7 @@ public class DefaultTermInitializer implements ITermInitializer {
        }
 
        protected void doInitialize(){
-               Map<UUID,DefinedTermBase> terms = new HashMap<UUID,DefinedTermBase>();
+               Map<UUID,DefinedTermBase> terms = new HashMap<>();
 
 //             for(Class<? extends DefinedTermBase<?>> clazz : classesToInitialize) {
                for(VocabularyEnum vocabularyEnum : VocabularyEnum.values()) {
index 1c0988258b44dc586b279f8d9458260824fb0a45..1941d637efdd5c2d1a91a5bfc749b4c5fdad2e52 100644 (file)
@@ -46,17 +46,17 @@ public abstract class NonViralNameParserImplRegExBase  {
     protected static String nonCapitalWord = "\\p{javaLowerCase}+";
     protected static String word = "(" + capitalWord + "|" + nonCapitalWord + ")"; //word (capital or non-capital) with no '.' at the end
     protected static String uppercaseWord = "\\p{javaUpperCase}{2,}";
-    protected static String apostrophWord = word + "('\\p{javaLowerCase}*)?";
+    protected static String apostropheWord = word + "('\\p{javaLowerCase}*)?"; //word with optional apostrophe in between
 
-    protected static String capitalDotWord = capitalWord + "\\.?"; //capitalWord with facultativ '.' at the end
-    protected static String capital2charDotWord = "(" + capital2LetterWord + "\\.?|\\p{javaUpperCase}\\.)"; //capitalWord with facultativ '.' but minimum 2 characters (single capital word like 'L' is not allowed
+    protected static String capitalDotWord = capitalWord + "\\.?"; //capitalWord with facultative '.' at the end
+    protected static String capital2charDotWord = "(" + capital2LetterWord + "\\.?|\\p{javaUpperCase}\\.)"; //capitalWord with facultative '.' but minimum 2 characters (single capital word like 'L' is not allowed
     protected static String twoCapitalDotWord = "\\p{javaUpperCase}{2}\\.";   //e.g. NY.
 
-    protected static String nonCapitalDotWord = nonCapitalWord + "\\.?"; //nonCapitalWord with facultativ '.' at the end
-    protected static String dotWord = "(" + capitalWord + "|" + nonCapitalWord + ")\\.?"; //word (capital or non-capital) with facultativ '.' at the end
+    protected static String nonCapitalDotWord = nonCapitalWord + "\\.?"; //nonCapitalWord with facultative '.' at the end
+    protected static String dotWord = "(" + capitalWord + "|" + nonCapitalWord + ")\\.?"; //word (capital or non-capital) with facultative '.' at the end
     protected static String obligateDotWord = "(" + capitalWord + "|" + nonCapitalWord + ")\\.+"; //word (capital or non-capital) with obligate '.' at the end
 
-    //Words used in an epethiton for a TaxonName
+    //Words used in an epithet for a TaxonName
     protected static String nonCapitalEpiWord = "[a-z\u00EF\u00EB\u00F6\\-]+";   //a-z + diaeresis for ieo
     protected static String capitalEpiWord = "[A-Z]"+ nonCapitalEpiWord;
 
@@ -197,8 +197,8 @@ public abstract class NonViralNameParserImplRegExBase  {
     protected static String pTitleWordSeparator = "(\\."+ fWs+"|" + oWs + "|\\.?[-\u2013])";
     protected static String pSeriesPart = ",?" + fWs + "[sS]er(\\.)?" + oWs + "\\d{1,2},?";
 
-    protected static String referenceTitleFirstPart = "(" + apostrophWord + pTitleWordSeparator + "|" + twoCapitalDotWord + fWs + ")";
-    protected static String referenceTitle = referenceTitleFirstPart + "*" + "("+ dotWord + "|" + uppercaseWord + "|" + pSeriesPart + ")";  //reference title may have words seperated by whitespace or dot. The last word may not have a whitespace at the end. There must be at least one word
+    protected static String referenceTitleFirstPart = "(" + apostropheWord + pTitleWordSeparator + "|" + twoCapitalDotWord + fWs + ")";
+    protected static String referenceTitle = referenceTitleFirstPart + "*" + "("+ dotWord + "|" + uppercaseWord + "|" + pSeriesPart + ")";  //reference title may have words separated by whitespace or dot. The last word may not have a whitespace at the end. There must be at least one word
     protected static String referenceTitleWithSepCharacters = "(((" + referenceTitle +"|\\(.+\\))"  + anySepChar + ")*" + referenceTitle + ")"; //,?
     //TODO test performance ??
     protected static String referenceTitleWithSepCharactersAndBrackets = referenceTitleWithSepCharacters + fWs + "(\\(" + referenceTitleWithSepCharacters + "\\)"+fWs+ ")?(" + referenceTitleWithSepCharacters +")?"  ;
index 6b499cbe8c0450ab732449631801e9d46a70aebe..38272eb0bcf3763064ddebab00f31c45949026c2 100644 (file)
@@ -42,7 +42,7 @@ public class PersistentTermInitializerTest extends CdmIntegrationTest {
 //     @Test
 //     @DataSet("TermsDataSet.xml")
 //     public void testFirstPass() {
-//             Map<UUID, DefinedTermBase> persistedTerms = new HashMap<UUID, DefinedTermBase>();
+//             Map<UUID, DefinedTermBase> persistedTerms = new HashMap<>();
 //             persistentTermInitializer.firstPass(VocabularyEnum.Rank, persistedTerms);
 //     }