Revision: 14599
http://gate.svn.sourceforge.net/gate/?rev=14599&view=rev
Author: markagreenwood
Date: 2011-11-23 15:48:27 +0000 (Wed, 23 Nov 2011)
Log Message:
-----------
kind of fixed the original unit code, in that what we now return is sensible
although not really what we want
Modified Paths:
--------------
gate/trunk/plugins/Tagger_Measurements/src/gate/creole/measurements/Measurement.java
gate/trunk/plugins/Tagger_Measurements/src/gate/creole/measurements/MeasurementsParser.java
Modified:
gate/trunk/plugins/Tagger_Measurements/src/gate/creole/measurements/Measurement.java
===================================================================
---
gate/trunk/plugins/Tagger_Measurements/src/gate/creole/measurements/Measurement.java
2011-11-23 15:45:55 UTC (rev 14598)
+++
gate/trunk/plugins/Tagger_Measurements/src/gate/creole/measurements/Measurement.java
2011-11-23 15:48:27 UTC (rev 14599)
@@ -86,7 +86,13 @@
* @return the unit recognised in the parsed text
*/
public String getUnit() {
- return origUnit;
+ // TODO it turns out that the origUnit isn't valid as it just sorts the
+ // pieces in alphabetical order which isn't really helpful, so far now we
+ // just revert to using the parsed text. It would be nice if we could
figure
+ // out a way of normalizing units without reduction (i.e. miles --> mile)
+ return origText.trim();
+
+ //return origUnit;
}
/**
Modified:
gate/trunk/plugins/Tagger_Measurements/src/gate/creole/measurements/MeasurementsParser.java
===================================================================
---
gate/trunk/plugins/Tagger_Measurements/src/gate/creole/measurements/MeasurementsParser.java
2011-11-23 15:45:55 UTC (rev 14598)
+++
gate/trunk/plugins/Tagger_Measurements/src/gate/creole/measurements/MeasurementsParser.java
2011-11-23 15:48:27 UTC (rev 14599)
@@ -232,19 +232,6 @@
/**
* Attempt to parse the string as a measurement. Parsing does not have to
* consume the entire string in order for a measurement to be found and
- * returned. Parsing will start from the beginning of the string.
- *
- * @param text
- * the text to parse
- * @return a measurement if one is found, null otherwise
- */
- public Measurement parse(String text) {
- return parse(text, 0);
- }
-
- /**
- * Attempt to parse the string as a measurement. Parsing does not have to
- * consume the entire string in order for a measurement to be found and
* returned.
*
* @param text
@@ -253,7 +240,8 @@
* the index within the text to start parsing from
* @return a measurement if one is found, null otherwise
*/
- public Measurement parse(String text, int index) {
+ @Deprecated
+ private Measurement parse(String text, int index) {
Measurement v = Measurement.fromString(text, index, this);
if(v == null) return null;
if(v.getNormalizedUnit().trim().equals("")) return null;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs