Skip to content

Commit 8eb509f

Browse files
phddyheedocpark
andauthored
fix: add missing type definitions from StrUtils.h (#39)
* fix: add missing type definitions from StrUtils.h * add reference comments to POS type definitions --------- Co-authored-by: Heedoc Park <[email protected]>
1 parent 207e68b commit 8eb509f

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

postype.go

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ import "fmt"
55
type POSType string
66

77
// NOTE: update isValid function when adding a new POSType.
8+
// POS type definitions from Kiwi C++ library:
9+
// - Type https://github.com/bab2min/Kiwi/blob/18b4062f98cf3beaedac149fc511a2708891f71d/include/kiwi/Types.h#L188-L219
10+
// - String https://github.com/bab2min/Kiwi/blob/18b4062f98cf3beaedac149fc511a2708891f71d/src/Utils.cpp#L300
811
const (
9-
POS_UNKNOWN POSType = "UNKNOWN"
12+
POS_UNKNOWN POSType = "UN"
1013

1114
POS_NNG POSType = "NNG"
1215
POS_NNP POSType = "NNP"
@@ -65,8 +68,6 @@ const (
6568
POS_SN POSType = "SN"
6669
POS_SB POSType = "SB"
6770

68-
POS_UN POSType = "UN"
69-
7071
POS_W_URL POSType = "W_URL"
7172
POS_W_EMAIL POSType = "W_EMAIL"
7273
POS_W_HASHTAG POSType = "W_HASHTAG"
@@ -82,6 +83,18 @@ const (
8283
POS_USER_2 POSType = "USER2"
8384
POS_USER_3 POSType = "USER3"
8485
POS_USER_4 POSType = "USER4"
86+
87+
POS_VV_I POSType = "VV-I"
88+
POS_VA_I POSType = "VA-I"
89+
POS_VX_I POSType = "VX-I"
90+
POS_XSA_I POSType = "XSA-I"
91+
92+
POS_VV_R POSType = "VV-R"
93+
POS_VA_R POSType = "VA-R"
94+
POS_VX_R POSType = "VX-R"
95+
POS_XSA_R POSType = "XSA-R"
96+
97+
POS_V POSType = "V"
8598
)
8699

87100
func (p POSType) isValid() bool {
@@ -134,7 +147,6 @@ func (p POSType) isValid() bool {
134147
POS_SH,
135148
POS_SN,
136149
POS_SB,
137-
POS_UN,
138150
POS_W_URL,
139151
POS_W_EMAIL,
140152
POS_W_HASHTAG,
@@ -147,7 +159,16 @@ func (p POSType) isValid() bool {
147159
POS_USER_1,
148160
POS_USER_2,
149161
POS_USER_3,
150-
POS_USER_4:
162+
POS_USER_4,
163+
POS_VV_I,
164+
POS_VA_I,
165+
POS_VX_I,
166+
POS_XSA_I,
167+
POS_VV_R,
168+
POS_VA_R,
169+
POS_VX_R,
170+
POS_XSA_R,
171+
POS_V:
151172
return true
152173
default:
153174
return false

0 commit comments

Comments
 (0)