From 0cbfc79c69ccbfca7ac42a1381d62d449bf1adf6 Mon Sep 17 00:00:00 2001 From: "cmzmasek@gmail.com" Date: Wed, 8 Aug 2012 07:40:54 +0000 Subject: [PATCH] Changed map parser to ignore " in lines like "x y z" (at ComPhy 2012 Moscow) --- forester/java/src/org/forester/application/decorator.java | 4 ++-- .../java/src/org/forester/archaeopteryx/Constants.java | 2 +- .../java/src/org/forester/tools/PhylogenyDecorator.java | 5 +++-- forester/java/src/org/forester/util/BasicTableParser.java | 12 ++++++++++++ forester/java/src/org/forester/util/ForesterConstants.java | 2 +- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/forester/java/src/org/forester/application/decorator.java b/forester/java/src/org/forester/application/decorator.java index 241ddaf..be44f67 100644 --- a/forester/java/src/org/forester/application/decorator.java +++ b/forester/java/src/org/forester/application/decorator.java @@ -71,8 +71,8 @@ public final class decorator { final static private String MAPPING_FILE_SEPARATOR_DEFAULT = ":"; final static private boolean USE_FIRST_SEPARATOR_ONLY = true; final static private String PRG_NAME = "decorator"; - final static private String PRG_VERSION = "1.10"; - final static private String PRG_DATE = "2009.10.08"; + final static private String PRG_VERSION = "1.11"; + final static private String PRG_DATE = "2012.08.08"; private static void argumentsError() { System.out.println(); diff --git a/forester/java/src/org/forester/archaeopteryx/Constants.java b/forester/java/src/org/forester/archaeopteryx/Constants.java index 75bae3d..6f98cf5 100644 --- a/forester/java/src/org/forester/archaeopteryx/Constants.java +++ b/forester/java/src/org/forester/archaeopteryx/Constants.java @@ -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.972+ 9M"; - final static String PRG_DATE = "2012.06.29"; + final static String PRG_DATE = "120808"; final static String DEFAULT_CONFIGURATION_FILE_NAME = "_aptx_configuration_file"; final static String[] DEFAULT_FONT_CHOICES = { "Verdana", "Tahoma", "Arial", "Helvetica", "Dialog", "Lucida Sans", "SansSerif", "Sans-serif", "Sans" }; diff --git a/forester/java/src/org/forester/tools/PhylogenyDecorator.java b/forester/java/src/org/forester/tools/PhylogenyDecorator.java index e67ae8e..f01701a 100644 --- a/forester/java/src/org/forester/tools/PhylogenyDecorator.java +++ b/forester/java/src/org/forester/tools/PhylogenyDecorator.java @@ -154,9 +154,10 @@ public final class PhylogenyDecorator { if ( new_values.containsKey( TP_NODE_NAME ) ) { node.setName( new_values.get( TP_NODE_NAME ) ); } - } - } + } // if ( new_values != null ) + } // if ( map.containsKey( name ) || ( numbers_of_chars_allowed_to_remove_if_not_found_in_map > 0 ) ) else if ( picky ) { + System.out.println( map.toString() ); throw new IllegalArgumentException( "\"" + name + "\" not found in name map" ); } } diff --git a/forester/java/src/org/forester/util/BasicTableParser.java b/forester/java/src/org/forester/util/BasicTableParser.java index 8ab9622..59e5cd2 100644 --- a/forester/java/src/org/forester/util/BasicTableParser.java +++ b/forester/java/src/org/forester/util/BasicTableParser.java @@ -67,6 +67,18 @@ public class BasicTableParser { final boolean use_start_of_comment_line = !( ForesterUtil.isEmpty( start_of_comment_line ) ); while ( ( line = reader.readLine() ) != null ) { line = line.trim(); + if ( !ForesterUtil.isEmpty( line) && + + + (( line.charAt( 0 ) == '"' && line.charAt( line.length() -1 ) == '"' && ForesterUtil.countChars( line, '"' ) == 2 ) + + || + + + ( line.charAt( 0 ) == '\'' && line.charAt( line.length() -1 ) == '\'' && ForesterUtil.countChars( line, '\'' ) == 2 ) ) ) { + line = line.substring( 1, line.length() -1 ).trim(); + } + if ( saw_first_table && ( ForesterUtil.isEmpty( line ) || ( tables_separated_by_single_string_line && ( line .indexOf( column_delimiter ) < 0 ) ) ) ) { diff --git a/forester/java/src/org/forester/util/ForesterConstants.java b/forester/java/src/org/forester/util/ForesterConstants.java index c39a50d..5e8813d 100644 --- a/forester/java/src/org/forester/util/ForesterConstants.java +++ b/forester/java/src/org/forester/util/ForesterConstants.java @@ -28,7 +28,7 @@ package org.forester.util; public final class ForesterConstants { public final static String FORESTER_VERSION = "1.005+"; - public final static String FORESTER_DATE = "120629"; + public final static String FORESTER_DATE = "120808"; public final static String PHYLO_XML_VERSION = "1.10"; public final static String PHYLO_XML_LOCATION = "http://www.phyloxml.org"; public final static String PHYLO_XML_XSD = "phyloxml.xsd"; -- 1.7.10.2