パッケージ nlp4j

インタフェース KeywordWithDependency

    • メソッドの詳細

      • getRelation

        String getRelation()
        係り受けのラベル
        戻り値:
        dependency label
        導入されたバージョン:
        1.2.1.0
      • setRelation

        void setRelation​(String relation)
        係り受けのラベル
        パラメータ:
        relation - 係り受けのラベル
        導入されたバージョン:
        1.2.1.0
      • addChild

        void addChild​(KeywordWithDependency keyword)
        依存関係の子ノードを追加します。子ノードには親ノードへの依存関係がセットされます。
        Add a child keyword. A parent keyword is set to child keyword.
        パラメータ:
        keyword - キーワード
      • addChildOnly

        void addChildOnly​(KeywordWithDependency keyword)
        依存関係の子ノードを追加します。子ノードには親ノードへの依存関係はセットされません。
        Add a child keywod without set a parent to child keyword.
        パラメータ:
        keyword - キーワード
      • asList

        List<KeywordWithDependency> asList()
        依存関係のあるキーワードをリストとして返します。
        Return keywords as a list from dependency keywords.
        戻り値:
        依存関係のあるキーワード
      • getChildren

        ArrayList<KeywordWithDependency> getChildren()
        依存関係のある子ノードのキーワードを返します。
        戻り値:
        子ノード
      • getDepth

        int getDepth()
        もっとも親の位置にあるキーワード(ルートキーワード)からの深さの位置を返します。
        戻り値:
        キーワードの深さ
      • getParent

        KeywordWithDependency getParent()
        親の依存関係のあるキーワードを返します。
        戻り値:
        キーワード
      • getParent

        KeywordWithDependency getParent​(int depth)
        階層の数を指定して親の依存関係のあるキーワードを返します。例えば2の場合、2段階親のキーワードを返します。
        パラメータ:
        depth - 深さ
        戻り値:
        キーワード
      • getRoot

        KeywordWithDependency getRoot()
        親の依存関係にあるキーワードで最も親(ルート)に位置するキーワードを返します。このキーワードが最も親のキーワードである場合 null を返します。
        戻り値:
        キーワード
      • getSequence

        int getSequence()
        文の中での出現順(連番)を返します。
        戻り値:
        キーワード
      • hasChild

        boolean hasChild()
        子の依存関係にあるキーワードがあるかどうかを返します。
        戻り値:
        子の依存関係にあるキーワードがあるかどうか
      • hasParent

        boolean hasParent()
        親の依存関係にあるキーワードがあるかどうかを返します。
        戻り値:
        親の依存関係にあるキーワードがあるかどうか
      • isRoot

        boolean isRoot()
        最も親の依存関係にあるキーワードを返します。このキーワードが最も親の場合 null を返します。
        戻り値:
        最も親の依存関係にあるキーワード
      • setParent

        void setParent​(KeywordWithDependency parent)
        親の依存関係にあるキーワードをセットします。親のキーワードにはこのキーワードが子キーワードとしてセットされます。
        パラメータ:
        parent - 親の依存関係にあるキーワード
      • setParentOnly

        void setParentOnly​(KeywordWithDependency parent)
        親の依存関係にあるキーワードをセットします。親のキーワードにはこのキーワードが子キーワードとしてセットされません。
        パラメータ:
        parent - 親の依存関係にあるキーワード
      • setSequence

        void setSequence​(int sequence)
        文の中での出現順(連番)をセットします。
        パラメータ:
        sequence - 連番
      • toStringAsDependencyList

        String toStringAsDependencyList()
        キーワードの依存関係を文字列で表現します。
        戻り値:
        キーワードの依存関係
      • toStringAsDependencyTree

        String toStringAsDependencyTree()
        キーワードの依存関係を文字列で表現します。
        戻り値:
        キーワードの依存関係
      • toStringAsXml

        String toStringAsXml()
        キーワードの依存関係をXML形式の文字列で表現します。
        戻り値:
        キーワードの依存関係
      • toStringAsXml

        Object toStringAsXml​(int depth)
        階層を指定してキーワードの依存関係をXML形式の文字列で表現します。
        パラメータ:
        depth - このオブジェクトの階層の深さ
        戻り値:
        文字列