From 96a4e7755e89135a8414b65c1486155e86fa2189 Mon Sep 17 00:00:00 2001 From: snaag Date: Mon, 26 Dec 2022 03:44:50 +0900 Subject: [PATCH] Add getTagSurface function --- data.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/data.js b/data.js index 47fcc95..702e97b 100644 --- a/data.js +++ b/data.js @@ -2172,6 +2172,16 @@ class Word extends ImmutableArray { * @inheritDoc */ + getTagSurface() { + return this.map(m => ({ tag: m._tag, surface: m.surface})) + } + /** + * tag 와 surface 로 이루어진 Object 로 반환합니다. + * + * 예) [ { tag: 'NNG', surface: '고양이' }, { tag: 'JX', surface: '는' } ] + * + * @return {Object} tag 와 surface 로 이루어진 Object + */ toString() { return `${this.surface} = ${this.singleLineString()}`;