// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final int ENDLESS = 1000;
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String FRED = "fred:";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String NULL = "Null";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String PIVOT = "Pivot";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String TOP = "top";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String VN_ROLE = "vn.role:";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String AMR_ARG = ":arg.";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String AMR_ARG0 = ":arg0";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String AMR_ARG1 = ":arg1";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String AMR_ARG2 = ":arg2";


import static amr2fred.Glossary.AMR_ARG1;
import static amr2fred.Glossary.AMR_ARG2;
import static amr2fred.Glossary.ENDLESS;
import static amr2fred.Glossary.FRED;
import static amr2fred.Glossary.NULL;
import static amr2fred.Glossary.PIVOT;
import static amr2fred.Glossary.TOP;
import static amr2fred.Glossary.VN_ROLE;
import static amr2fred.Glossary.NodeStatus.AMR;
import static amr2fred.Glossary.NodeStatus.OK;
import static amr2fred.Glossary.NodeStatus.REMOVE;
import static amr2fred.Glossary.NodeType.VERB;
import java.util.ArrayList;
import java.util.Iterator;
import static amr2fred.Glossary.AMR_ARG;
import static amr2fred.Glossary.AMR_ARG0;

        if (root.getStatus() == OK && root.relation.startsWith(Glossary.AMR_RELATION_BEGIN)
                && !root.relation.equalsIgnoreCase(TOP)) {
            root.setStatus(Glossary.NodeStatus.AMR);
            return root;
        }

        if (root.getStatus() != OK && !root.relation.startsWith(Glossary.AMR_RELATION_BEGIN)
                && !root.relation.equalsIgnoreCase(TOP)) {
            root.setStatus(OK);
        }

        if (instance != null) {

            if (instance.var.length() > 3 && instance.var.substring(instance.var.length() - 3).matches(Glossary.AMR_VERB)) {
                if (this.isVerb(instance.var)) {
                    root.setType(VERB);
                    topic = false;
                    instance.list.add(new Node(Glossary.DUL_EVENT, Glossary.RDFS_SUBCLASS_OF, OK));
                }

                root = modality(root);
                if (root.getStatus() == OK) {

                    instance = root.getInstance();
                    topic = false;
                    root.setType(VERB);
                }

                //Elaborazione della instance e trasferimento verbo nella root, seguito dal numero di occorrenza
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final int ENDLESS = 1000;
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String FRED = "fred:";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String NULL = "Null";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String PIVOT = "Pivot";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String TOP = "top";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String VN_ROLE = "vn.role:";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String AMR_ARG = ":arg.";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String AMR_ARG0 = ":arg0";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String AMR_ARG1 = ":arg1";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String AMR_ARG2 = ":arg2";


// Path: amr2Fred/src/amr2fred/Parser.java
import static amr2fred.Glossary.AMR_ARG1;
import static amr2fred.Glossary.AMR_ARG2;
import static amr2fred.Glossary.ENDLESS;
import static amr2fred.Glossary.FRED;
import static amr2fred.Glossary.NULL;
import static amr2fred.Glossary.PIVOT;
import static amr2fred.Glossary.TOP;
import static amr2fred.Glossary.VN_ROLE;
import static amr2fred.Glossary.NodeStatus.AMR;
import static amr2fred.Glossary.NodeStatus.OK;
import static amr2fred.Glossary.NodeStatus.REMOVE;
import static amr2fred.Glossary.NodeType.VERB;
import java.util.ArrayList;
import java.util.Iterator;
import static amr2fred.Glossary.AMR_ARG;
import static amr2fred.Glossary.AMR_ARG0;


        if (root.getStatus() == OK && root.relation.startsWith(Glossary.AMR_RELATION_BEGIN)
                && !root.relation.equalsIgnoreCase(TOP)) {
            root.setStatus(Glossary.NodeStatus.AMR);
            return root;
        }

        if (root.getStatus() != OK && !root.relation.startsWith(Glossary.AMR_RELATION_BEGIN)
                && !root.relation.equalsIgnoreCase(TOP)) {
            root.setStatus(OK);
        }

        if (instance != null) {

            if (instance.var.length() > 3 && instance.var.substring(instance.var.length() - 3).matches(Glossary.AMR_VERB)) {
                if (this.isVerb(instance.var)) {
                    root.setType(VERB);
                    topic = false;
                    instance.list.add(new Node(Glossary.DUL_EVENT, Glossary.RDFS_SUBCLASS_OF, OK));
                }

                root = modality(root);
                if (root.getStatus() == OK) {

                    instance = root.getInstance();
                    topic = false;
                    root.setType(VERB);
                }

                //Elaborazione della instance e trasferimento verbo nella root, seguito dal numero di occorrenza
                root.var = FRED + instance.var.substring(0, instance.var.length() - 3) + "_" + occurrence(instance.var.substring(0, instance.var.length() - 3));