// TextMeter.java import java.util.Map; /** * The TextMeter interface is implemented by parser plug-ins that * measure statistical properties of the parsed text. Tokens are * expected to be presented in the order they are found by the parser, * although for many measurements this is not critical. * * @author Fredrik Kilander for ID1006 */ public interface TextMeter { /** * Presents a word token to the TextMeter. * * @param wt The WordToken to add to the measurement. */ public void add (WordToken wt); /** * Presents a punctuation token to the TextMeter. * * @param wt The PunctToken to add to the measurement. */ public void add (PunctToken pt); /** * Returns a property map of the current measurement. The keys and * their values are defined by the implementation. * * @return The current properties of the current measurement. */ public Map properties (); /** * Retrieves a single property from the current measurement. If no * such property exists, null should be returned. * * @param key The key of the requested property. * @return The value of the requested property. */ public String getProperty (String key); } // interface TextMeter