コード例 #1
0
        /**
         * Convenience method to return the string corresponding to the question
         * word. Useful, since the types in this enum aren't all simply convertible
         * to strings (e.g. <code>WHO_SUBJCT</code> and <code>WHO_OBJECT</code> both
         * correspond to string <i>Who</i>)
         *
         * @return the string corresponding to the question word
         */

        public static string getString(this InterrogativeType i)
        {
            var s = "";

            switch (i)
            {
            case InterrogativeType.HOW:
            case InterrogativeType.HOW_PREDICATE:
                s = "how";
                break;

            case InterrogativeType.WHAT_OBJECT:
            case InterrogativeType.WHAT_SUBJECT:
                s = "what";
                break;

            case InterrogativeType.WHERE:
                s = "where";
                break;

            case InterrogativeType.WHO_INDIRECT_OBJECT:
            case InterrogativeType.WHO_OBJECT:
            case InterrogativeType.WHO_SUBJECT:
                s = "who";
                break;

            case InterrogativeType.WHY:
                s = "why";
                break;

            case InterrogativeType.HOW_MANY:
                s = "how many";
                break;

            case InterrogativeType.YES_NO:
                s = "yes/no";
                break;
            }

            return(s);
        }
コード例 #2
0
 /**
  * A method to determine if the {@code InterrogativeType} is a question
  * concerning an element with the discourse function of an indirect object.
  *
  * @param type
  *            the interrogative type to be checked
  * @return <code>true</code> if the type concerns an indirect object,
  *         <code>false</code> otherwise.
  */
 public static bool isIndirectObject(this InterrogativeType type)
 {
     return(type == InterrogativeType.WHO_INDIRECT_OBJECT);
 }
コード例 #3
0
 /**
  * A method to determine if the {@code InterrogativeType} is a question
  * concerning an element with the discourse function of an object.
  *
  * @param type
  *            the interrogative type to be checked
  * @return <code>true</code> if the type concerns an object,
  *         <code>false</code> otherwise.
  */
 public static bool isObject(this InterrogativeType type)
 {
     return(type == InterrogativeType.WHO_OBJECT || type == InterrogativeType.WHAT_OBJECT);
 }