cleanup
authorcmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 16 Apr 2014 01:27:35 +0000 (01:27 +0000)
committercmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 16 Apr 2014 01:27:35 +0000 (01:27 +0000)
forester/java/src/org/forester/archaeopteryx/Constants.java
forester/java/src/org/forester/io/parsers/util/ParserUtils.java
forester/java/src/org/forester/test/Test.java

index be02fd7..0ad0eb9 100644 (file)
@@ -43,7 +43,7 @@ public final class Constants {
     public final static boolean ALLOW_DDBJ_BLAST                                              = false;
     public final static String  PRG_NAME                                                      = "Archaeopteryx";
     final static String         VERSION                                                       = "0.988 SR";
-    final static String         PRG_DATE                                                      = "140418";
+    final static String         PRG_DATE                                                      = "140415";
     final static String         DEFAULT_CONFIGURATION_FILE_NAME                               = "_aptx_configuration_file";
     final static String[]       DEFAULT_FONT_CHOICES                                          = { "Arial", "Helvetica",
             "Verdana", "Tahoma", "Dialog", "Lucida Sans", "SansSerif", "Sans-serif", "Sans"  };
index 4c650a1..d056ba3 100644 (file)
@@ -72,11 +72,11 @@ public final class ParserUtils {
     final public static Pattern  TAXOMONY_SN_PATTERN_STRAIN_1         = Pattern
                                                                               .compile( "(?:\\b|_)("
                                                                                       + SN_BN
-                                                                                      + "[_ ](?:str|subsp|var)[a-z]{0,5}\\.?[_ ]\\S{1,60})(?:\\b|_)" );
+                                                                                      + "[_ ](?:str|subsp|ssp|var)[a-z]{0,5}\\.?[_ ]\\S{1,60})(?:\\b|_)" );
     final public static Pattern  TAXOMONY_SN_PATTERN_STRAIN_2         = Pattern
                                                                               .compile( "(?:\\b|_)("
                                                                                       + SN_BN
-                                                                                      + "[_ ]\\((?:str|subsp|var)[a-z]{0,5}\\.?[_ ]\\S{1,60}\\))" );
+                                                                                      + "[_ ]\\((?:str|subsp|ssp|var)[a-z]{0,5}\\.?[_ ]\\S{1,60}\\))" );
     final public static Pattern  TAXOMONY_SN_PATTERN_STRAIN_SUBSTRAIN = Pattern
                                                                               .compile( "(?:\\b|_)("
                                                                                       + SN_BN
@@ -236,6 +236,12 @@ public final class ParserUtils {
             else if ( s.indexOf( " subsp " ) > 4 ) {
                 s = s.replaceFirst( " subsp ", " subsp. " );
             }
+            else if ( s.indexOf( " ssp " ) > 4 ) {
+                s = s.replaceFirst( " ssp ", " subsp. " );
+            }
+            else if ( s.indexOf( " ssp. " ) > 4 ) {
+                s = s.replaceFirst( " ssp. ", " subsp. " );
+            }
             else if ( s.indexOf( " var " ) > 4 ) {
                 s = s.replaceFirst( " var ", " var. " );
             }
@@ -250,6 +256,12 @@ public final class ParserUtils {
             else if ( s.indexOf( " (subsp " ) > 4 ) {
                 s = s.replaceFirst( " \\(subsp ", " (subsp. " );
             }
+            else if ( s.indexOf( " (ssp " ) > 4 ) {
+                s = s.replaceFirst( " \\(ssp ", " (subsp. " );
+            }
+            else if ( s.indexOf( " (ssp. " ) > 4 ) {
+                s = s.replaceFirst( " \\(ssp. ", " (subsp. " );
+            }
             else if ( s.indexOf( " (var " ) > 4 ) {
                 s = s.replaceFirst( " \\(var ", " (var. " );
             }
index 8a937e9..f57b0be 100644 (file)
@@ -4373,7 +4373,6 @@ public final class Test {
                     .equals( "Escherichia coli str. K-12 substr. MG1655star" ) ) {
                 return false;
             }
-            //
             if ( !ParserUtils.extractScientificNameFromNodeName( "Macrocera sp." ).equals( "Macrocera sp." ) ) {
                 return false;
             }
@@ -4390,6 +4389,22 @@ public final class Test {
             if ( !ParserUtils.extractScientificNameFromNodeName( "Macrocera sp" ).equals( "Macrocera sp." ) ) {
                 return false;
             }
+            if ( !ParserUtils.extractScientificNameFromNodeName( "Sesamum rigidum ssp merenskyanum 07 48" )
+                    .equals( "Sesamum rigidum subsp. merenskyanum" ) ) {
+                return false;
+            }
+            if ( !ParserUtils.extractScientificNameFromNodeName( "Sesamum rigidum ssp. merenskyanum" )
+                    .equals( "Sesamum rigidum subsp. merenskyanum" ) ) {
+                return false;
+            }
+            if ( !ParserUtils.extractScientificNameFromNodeName( "Sesamum rigidum (ssp. merenskyanum)" )
+                    .equals( "Sesamum rigidum (subsp. merenskyanum)" ) ) {
+                return false;
+            }
+            if ( !ParserUtils.extractScientificNameFromNodeName( "Sesamum rigidum (ssp merenskyanum)" )
+                    .equals( "Sesamum rigidum (subsp. merenskyanum)" ) ) {
+                return false;
+            }
         }
         catch ( final Exception e ) {
             e.printStackTrace( System.out );