package jp.gr.java_conf.dyama.rink.parser.core;

/**
 * Interface of Dependency Parsing Action
 * @author Hiroyasu Yamada
 *
 */
public interface Action {

    /**
     * Type of Action
     */
    public static enum Type {

        /**
         * The action for the no dependency relation between left and right target node.
         * Move the current position to the right.
         */
        SHIFT(1),

        /**
         * The action that there is an dependency between the left and right target node,
         * but the subtree of a child node has not been complete yet.
         * Move the current position to the right.
         */
        WAIT(2),

        /**
         * The action for a dependency relation that the left node is the parent of the right node.
         * Move the current position to the left after applying this action.
         */
        LEFT(3),

        /**
         * The action for a dependency relation that the right node is the parent of the left node
         * stay current position after applying this action.
         */
        RIGHT(4);

        private int id_;
        private Type(int id){
            id_ = id ;
        }

        /**
         * get the action ID
         * @return action ID
         */
        public int getID(){
            return id_ ;
        }

        private static final Type[] types_ = Type.values();
        /**
         * parse integer into the type of actions.
         * @param i integer
         * @return type of actions. return null if i is undefined.
         */
        static Type parseInt(int i){
            for(int k = 0 ; k < types_.length ; k++ ){
                if (types_[k].getID() == i)
                    return types_[k];
            }
            return null;
        }
    }

    /**
     * get the score
     * @return score
     */
    public double getScore();

    /**
     * get the node ID of the left target node.
     * @return node ID
     */
    public int getLeftTarget();

    /**
     * get the node ID of the right target node.
     * @return node ID
     */
    public int getRightTarget();

    /**
     * get the type of Actions
     * @return type of Actions
     */
    public Type getType();


}

@@ -165,16 +165,20 @@
      * T
+he t
 ype of A
@@ -541,15 +541,29 @@
  of 
-a child
+the left/right target
  nod
@@ -702,33 +702,44 @@
  The action for 
-a
+building the
  dependency rela
@@ -940,17 +940,28 @@
 ion for 
-a
+building the
  depende
@@ -1224,27 +1224,31 @@
 %0A         * 
-g
+R
 et
+urns
  the action 
@@ -1242,24 +1242,26 @@
 s the action
+'s
  ID%0A        
@@ -1271,22 +1271,28 @@
 @return 
+the 
 action
+'s
  ID%0A    
@@ -1446,21 +1446,26 @@
       * 
-p
+P
 arse
+s the
  integer
@@ -1511,16 +1511,20 @@
 param i 
+the 
 integer%0A
@@ -1534,32 +1534,36 @@
       * @return 
+the 
 type of actions.
@@ -1847,27 +1847,31 @@
  /**%0A     * 
-g
+R
 et
+urns
  the score%0A 
@@ -1936,35 +1936,39 @@
 %0A    /**%0A     * 
-g
+R
 et
+urns
  the node ID of 
@@ -1996,32 +1996,36 @@
 %0A     * @return 
+the 
 node ID%0A     */%0A
@@ -2068,27 +2068,31 @@
  /**%0A     * 
-g
+R
 et
+urns
  the node ID
@@ -2133,16 +2133,20 @@
 @return 
+the 
 node ID%0A
@@ -2202,19 +2202,23 @@
 %0A     * 
-g
+R
 et
+urns
  the typ
@@ -2241,24 +2241,28 @@
   * @return 
+the 
 type of Acti
@@ -2300,12 +2300,10 @@
 Type();%0A
-%0A%0A
 %7D%0A

revise API document.