package javakurs.musterloesung.uebung02.aufgabe1;

/**
 * {@link TypedFeatStructTest} is a test class for {@link TypedFeatStruct}.
 *
 * @author Joerg Steffen, DFKI
 * @version $Id: TypedFeatStructTest.java,v 1.1 2010/11/11 16:51:25 steffen Exp $
 */
public final class TypedFeatStructTest {

  /**
   * This would create a new instance of {@link TypedFeatStructTest}. Not to be
   * used.
   */
  private TypedFeatStructTest() {

    // private constructor to enforce noninstantiability
  }


  /**
   * This is the main method. It requires no arguments.
   *
   * @param args
   *          the arguments; not used here
   */
  public static void main(String[] args) {

    // create new feature structure
    TypedFeatStruct agrTfs1 = new TypedFeatStruct("agr");
    agrTfs1.addFeatValPair(new FeatValPair("NUMBER", "pl"));
    agrTfs1.addFeatValPair(new FeatValPair("GENDER", "fem"));

    TypedFeatStruct subjTfs = new TypedFeatStruct("infl");
    subjTfs.addFeatValPair(new FeatValPair("STEM", "Katzen"));
    subjTfs.addFeatValPair(new FeatValPair("AGR", agrTfs1));

    TypedFeatStruct agrTfs2 = new TypedFeatStruct("agr");
    agrTfs2.addFeatValPair(new FeatValPair("NUMBER", "pl"));
    agrTfs2.addFeatValPair(new FeatValPair("PERSON", "3rd"));

    TypedFeatStruct predTfs = new TypedFeatStruct("infl");
    predTfs.addFeatValPair(new FeatValPair("STEM", "schnurren"));
    predTfs.addFeatValPair(new FeatValPair("AGR", agrTfs2));

    TypedFeatStruct topTfs = new TypedFeatStruct("avm");
    topTfs.addFeatValPair(new FeatValPair("SUBJ", subjTfs));
    topTfs.addFeatValPair(new FeatValPair("PRED", predTfs));

    // print feature structure
    System.out.println(topTfs.toString());
  }
}
