From e9bf8327e1c9a7795ac7269e04d98c0570648fe4 Mon Sep 17 00:00:00 2001 From: "cmzmasek@gmail.com" Date: Sat, 12 Apr 2014 02:35:07 +0000 Subject: [PATCH] inprogress --- forester/java/src/org/forester/io/parsers/util/ParserUtils.java | 4 ++-- forester/java/src/org/forester/test/Test.java | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/forester/java/src/org/forester/io/parsers/util/ParserUtils.java b/forester/java/src/org/forester/io/parsers/util/ParserUtils.java index 8adaa71..77af4c8 100644 --- a/forester/java/src/org/forester/io/parsers/util/ParserUtils.java +++ b/forester/java/src/org/forester/io/parsers/util/ParserUtils.java @@ -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 diff --git a/forester/java/src/org/forester/test/Test.java b/forester/java/src/org/forester/test/Test.java index 0f565a4..5b3b42f 100644 --- a/forester/java/src/org/forester/test/Test.java +++ b/forester/java/src/org/forester/test/Test.java @@ -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; } } -- 1.7.10.2