001    
002    package edu.upenn.cis.propbank_shen;
003    
004    import java.io.*;
005    
006    /**
007       the "aspect" part of inflectional information.  we represent aspect 
008       as either "perfect", "progressive" or "perfect progressive". 
009    
010       @author Scott Cotton
011       @see edu.upenn.cis.propbank_shen.Inflection
012     */
013    public final class InflAspect {
014    
015        private String srep;
016        /** use a private constructor so that only static members
017            can be referenced.  This helps us emulate an enumeration */
018        private InflAspect(String s) {srep = s;}
019    
020    
021        /** the Perfect voice */
022        public static final InflAspect Perfect = new InflAspect("p");
023        /** the progressive voice */
024        public static final InflAspect Progressive = new InflAspect("o");
025        /** the perfect progressive voice */
026        public static final InflAspect Both = new InflAspect("b");
027        /** no aspect specified */
028        public static final InflAspect NoAspect = new InflAspect("-");
029    
030        public String toString() { return srep; }
031        public static InflAspect ofString(String s) 
032        {
033            if (s.equals("p")) { return InflAspect.Perfect; }
034            else if (s.equals("o")) { return InflAspect.Progressive; }
035            else if (s.equals("b")) { return InflAspect.Both; }
036            else if (s.equals("-")) { return InflAspect.NoAspect; }
037            else {
038                System.err.println("invalid inflection.aspect string: "
039                                   + s
040                                   + ", defaulting to NoAspect.");
041                return InflAspect.NoAspect;
042            }
043        }
044    }
045