in progress
[jalview.git] / forester / java / src / org / forester / io / parsers / nhx / NHXParser.java
index 8dba277..c373104 100644 (file)
@@ -60,7 +60,7 @@ import org.forester.util.ForesterUtil;
 
 public final class NHXParser implements PhylogenyParser {
 
-    public static final boolean                              LIMIT_SPECIES_NAMES_TO_FIVE_CHARS = true;
+    public static final boolean                              LIMIT_SPECIES_NAMES_TO_FIVE_CHARS = false;
     public static final PhylogenyMethods.TAXONOMY_EXTRACTION TAXONOMY_EXTRACTION_DEFAULT       = PhylogenyMethods.TAXONOMY_EXTRACTION.NO;
     final static private boolean                             GUESS_ROOTEDNESS_DEFAULT          = true;
     final static private boolean                             GUESS_IF_SUPPORT_VALUES           = true;
@@ -87,7 +87,7 @@ public final class NHXParser implements PhylogenyParser {
     public final static Pattern                              UC_LETTERS_NUMBERS_PATTERN        = Pattern
                                                                                                        .compile( "^[A-Z0-9]+$" );
     public final static Pattern                              NUMBERS_ONLY_PATTERN              = Pattern
-                                                                                                       .compile( "^[0-9]+$" );
+                                                                                                       .compile( "^[0-9\\.]+$" );
     public final static Pattern                              MB_PROB_PATTERN                   = Pattern
                                                                                                        .compile( "prob=([^,]+)" );
     public final static Pattern                              MB_PROB_SD_PATTERN                = Pattern
@@ -128,7 +128,7 @@ public final class NHXParser implements PhylogenyParser {
                       isReplaceUnderscores() );
             if ( NHXParser.GUESS_IF_SUPPORT_VALUES ) {
                 if ( NHXParser.isBranchLengthsLikeBootstrapValues( getCurrentPhylogeny() ) ) {
-                    NHXParser.moveBranchLengthsToBootstrapValues( getCurrentPhylogeny() );
+                    NHXParser.moveBranchLengthsToConfidenceValues( getCurrentPhylogeny() );
                 }
             }
             if ( isGuessRootedness() ) {
@@ -308,9 +308,9 @@ public final class NHXParser implements PhylogenyParser {
                         && ( ( c != '[' ) && ( c != '.' ) && ( ( c < 48 ) || ( c > 57 ) ) ) ) {
                     saw_colon = false;
                 }
-            }
-            if ( in_open_bracket && ( c == ']' ) ) {
-                in_open_bracket = false;
+                if ( in_open_bracket && ( c == ']' ) ) {
+                    in_open_bracket = false;
+                }
             }
             // \n\t is always ignored,
             // as is " (34) and ' (39) (space is 32):
@@ -631,7 +631,7 @@ public final class NHXParser implements PhylogenyParser {
         return true;
     }
 
-    private static void moveBranchLengthsToBootstrapValues( final Phylogeny p ) {
+    private static void moveBranchLengthsToConfidenceValues( final Phylogeny p ) {
         final PhylogenyNodeIterator it = p.iteratorPostorder();
         while ( it.hasNext() ) {
             final PhylogenyNode n = it.next();