inprogress
authorcmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Sat, 12 Apr 2014 02:35:07 +0000 (02:35 +0000)
committercmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Sat, 12 Apr 2014 02:35:07 +0000 (02:35 +0000)
forester/java/src/org/forester/io/parsers/util/ParserUtils.java
forester/java/src/org/forester/test/Test.java

index 8adaa71..77af4c8 100644 (file)
@@ -67,8 +67,8 @@ public final class ParserUtils {
     final public static Pattern  TAXOMONY_SN_PATTERN_STRAIN_1    = Pattern
                                                                          .compile( "\\b([A-Z][a-z]+[_ ][a-z]{2,30}[_ ](?:str|subsp|var)[a-z]{0,5}\\.?[_ ]\\S{1,60})(?:\\b|_)" );
     final public static Pattern  TAXOMONY_SN_PATTERN_STRAIN_2    = Pattern
-                                                                         .compile( "\\b([A-Z][a-z]+[_ ][a-z]{2,30}[_ ]\\((?:str|subsp|var)[a-z]{0,5}\\.?[_ ]\\S{1,60})(?:\\b|_)" );
-    final public static Pattern  TAXOMONY_SN_PATTERN_GENUS       = Pattern.compile( "([A-Z][a-z]{2,})" );
+                                                                         .compile( "\\b([A-Z][a-z]+[_ ][a-z]{2,30}[_ ]\\((?:str|subsp|var)[a-z]{0,5}\\.?[_ ]\\S{1,60}\\))(?:\\b|_)?" );
+    final public static Pattern  TAXOMONY_SN_PATTERN_GENUS       = Pattern.compile( "([A-Z][a-z]{2,30})" );
     final private static Pattern TAXOMONY_CODE_PATTERN_PFS       = Pattern.compile( "(?:\\b|_)[A-Z0-9]{4,}_("
                                                                          + TAX_CODE + ")/\\d+-\\d+\\b" );
     final private static Pattern TAXOMONY_UNIPROT_ID_PATTERN_PFR = Pattern
index 0f565a4..5b3b42f 100644 (file)
@@ -4246,9 +4246,12 @@ public final class Test {
                     .equals( "Verbascum sinuatum var. adenosepalum" ) ) {
                 return false;
             }
-            if ( !ParserUtils.extractScientificNameFromNodeName( "Escherichia coli (strain K12) " )
+            if ( !ParserUtils.extractScientificNameFromNodeName( "Escherichia coli (strain K12)" )
+                    .equals( "Escherichia coli (strain K12)" ) ) {
+                return false;
+            }
+            if ( !ParserUtils.extractScientificNameFromNodeName( "Escherichia coli (strain K12) bcl2" )
                     .equals( "Escherichia coli (strain K12)" ) ) {
-                System.out.println( ParserUtils.extractScientificNameFromNodeName( "Escherichia coli (strain K12)" ) );
                 return false;
             }
         }