changeset 6414:61e55f36e764 double-precision

Flow Velocity Parser: fixed regular expression for guessing main values
author Tom Gottfried <tom.gottfried@intevation.de>
date Tue, 25 Jun 2013 10:57:08 +0200
parents df867072d003
children 1bdfc099286e
files backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java	Mon Jun 24 15:24:07 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java	Tue Jun 25 10:57:08 2013 +0200
@@ -34,25 +34,25 @@
         Logger.getLogger(FlowVelocityModelParser.class);
 
     private static final Pattern META_REGEX =
-        Pattern.compile(".*Rechnung (.*) \\(Pegel (.*)\\).*");
+        Pattern.compile(".*Rechnung [unter ]*(.*) \\(Pegel (.*)\\).*");
 
     private static final Pattern META_GAUGE =
         Pattern.compile("(.*) Q=(\\w*)m3/s");
 
     private static final Pattern META_MAINVALUE_A =
-        Pattern.compile("([a-zA-Z]+)+(\\d+)*");
+        Pattern.compile("([a-zA-Z]+)+(\\d+)*\\S*");
 
     private static final Pattern META_MAINVALUE_B =
-        Pattern.compile("(([a-zA-Z]+)+(\\d+)*)\\s*-\\s*(([a-zA-Z]+)+(\\d+)*.*)");
+        Pattern.compile("(([a-zA-Z]+)+(\\d+)*)\\s*-\\s*(([a-zA-Z]+)+(\\d+)*\\S*)");
 
     private static final Pattern META_MAINVALUE_C =
-        Pattern.compile("([0-9]++)\\s?(\\w*)|([0-9]++,[0-9]++)\\s?(\\w*)");
+        Pattern.compile("([0-9]++)\\s?(\\S*)|([0-9]++,[0-9]++)\\s?(\\S*)");
 
     private static final Pattern META_MAINVALUE_D =
-        Pattern.compile("(([0-9]*)\\s?(\\w*)|([0-9]++,[0-9]++)\\s?(\\w*))\\s*bis (([0-9]*)\\s?([a-zA-Z_0-9()]*)|([0-9]++,[0-9]++)\\s?(.*))");
+        Pattern.compile("(([0-9]*)\\s?(\\w*)|([0-9]++,[0-9]++)\\s?(\\w*))\\s*bis (([0-9]*)\\s?(\\S*)|([0-9]++,[0-9]++)\\s?(\\S*))");
 
     private static final Pattern META_MAINVALUE_E =
-        Pattern.compile("(([a-zA-Z]+)+(\\d+)*)\\s*bis (([a-zA-Z]+)+(\\d+)*.*)");
+        Pattern.compile("(([a-zA-Z]+)+(\\d+)*)\\s*bis (([a-zA-Z]+)+(\\d+)*\\S*)");
 
     private static final NumberFormat nf =
         NumberFormat.getInstance(DEFAULT_LOCALE);

http://dive4elements.wald.intevation.org