CTAT 3.1 Function Reference

edu.cmu.pact.BehaviorRecorder.ProblemModel.Matcher.Functions
Class plural

java.lang.Object
  extended by edu.cmu.pact.BehaviorRecorder.ProblemModel.Matcher.Functions.plural

public class plural
extends java.lang.Object

Under control of a given count, return the singular or plural form of a word.


Constructor Summary
plural()
           
 
Method Summary
static void main(String[] args)
          Test harness for command-line use.
 String plural(int count, String word)
          Under control of a given count, return the singular or plural form of a word.
 String plural(int count, String word, String suffixToStrip, String suffixToAdd)
          Under control of a given count, return the singular or plural form of a word.
static void usageExit(String intro)
          Print a usage message and exit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

plural

public plural()
Method Detail

plural

public String plural(int count,
                     String word)

Under control of a given count, return the singular or plural form of a word. If the given count is greater than one, make the given word plural using default rules.

Parameters:
count - number to test
word - singular form of word to modify
Returns:
word if count < 2; else plural form of word

plural

public String plural(int count,
                     String word,
                     String suffixToStrip,
                     String suffixToAdd)

Under control of a given count, return the singular or plural form of a word. If the given count is greater than one, make the given word plural by removing a given suffix and appending a different one.

Parameters:
count - number to test
word - singular form of word to modify
suffixToStrip -
suffixToAdd - new suffix to add
Returns:
word if count < 2; else plural form of word

usageExit

public static void usageExit(String intro)
Print a usage message and exit.

Parameters:
intro - optional prefix to message

main

public static void main(String[] args)
Test harness for command-line use. E.g. plural 4 oddity plural 2 phenomenon on a

Parameters:
args - see usageExit(String)

CTAT 3.1 Function Reference