edu.stanford.nlp.math
Class NumberMatchingRegex

java.lang.Object
  extended by edu.stanford.nlp.math.NumberMatchingRegex

public class NumberMatchingRegex
extends java.lang.Object

This file includes a regular expression to match numbers. This will save quite a bit of time in places where you want to test if something is a number without wasting the time to parse it or throw an exception if it isn't. For example, you can call isDouble() to see if a String is a double without having to try/catch the NumberFormatException that gets produced if it is not. The regular expression is conveniently provided in the javadoc for Double. http://java.sun.com/javase/6/docs/api/java/lang/Double.html

Author:
John Bauer (sort of)

Method Summary
static boolean isDecimalInteger(java.lang.String string)
          Tests to see if an integer is a decimal integer, perhaps starting with +/-.
static boolean isDouble(java.lang.String string)
          Returns true if the number can be successfully parsed by Double.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isDecimalInteger

public static boolean isDecimalInteger(java.lang.String string)
Tests to see if an integer is a decimal integer, perhaps starting with +/-.


isDouble

public static boolean isDouble(java.lang.String string)
Returns true if the number can be successfully parsed by Double. Locale specific to English and ascii numerals.



Stanford NLP Group