koalanlp / kr.bydelta.koala.data / Tree

Tree

abstract class Tree<L : Enum<*>, T : Tree<L, T>> : CanHaveProperty, List<T> (source)

T-type들의 트리 구조를 저장할 Property입니다. Word를 묶어서 표현하는 구조에 적용됩니다.

Since
2.0.0

Constructors

<init>

트리 형태의 구조를 저장합니다.

Tree(label: L, terminal: Word?, children: List<T>)

Properties

label

트리에 붙어있는 표지자입니다. Null일 수 없습니다.

val label: L

terminal

트리의 노드에서 연결되는 Word

val terminal: Word?

Functions

equals

Indicates whether some other object is "equal to" this one.

open fun equals(other: Any?): Boolean

getNonTerminals

이 노드의 Non-terminal 자식 노드를 모읍니다.

fun getNonTerminals(): List<T>

getParent

부모 노드를 반환합니다.

fun getParent(): T?

getTerminals

이 노드를 포함해 모든 하위 Non-terminal 노드들에 속하는 terminal node들을 모읍니다.

fun getTerminals(): List<Word>

getTreeString

이 트리구조를 표현하는 텍스트 표현을 buffer에 담아 반환합니다.

fun getTreeString(depth: Int = 0, buffer: StringBuffer = StringBuffer()): StringBuffer

hashCode

Returns a hash code value for the object. The general contract of hashCode is:

open fun hashCode(): Int

hasNonTerminals

이 노드가 (terminal node를 제외하고) 자식 노드를 갖는지 확인합니다.

fun hasNonTerminals(): Boolean

isRoot

이 노드가 최상위 노드인지 확인합니다.

fun isRoot(): Boolean

toString

Returns a string representation of the object.

open fun toString(): String

Inheritors

SyntaxTree

구문구조 분석의 결과를 저장할 Property.

class SyntaxTree : Tree<PhraseTag, SyntaxTree>