public WordNet(String synsets, String hypernyms) {
        if (synsets == null || hypernyms == null) {
            throw new java.lang.NullPointerException("inputs cannot be null!");
        }
        V = parseSynsets(synsets);
        digraph = parseHypernyms(hypernyms);
        if (!isRootedDAG(digraph)) {
            throw new IllegalArgumentException("input should be a rooted DAG");
        }
        sap = new SAP(digraph);
    }