Skip to main content

PosTag

Enum PosTag 

Source
#[repr(u8)]
pub enum PosTag {
Show 45 variants NNG = 0, NNP = 1, NNB = 2, NNBC = 3, NP = 4, NR = 5, VV = 10, VA = 11, VX = 12, VCP = 13, VCN = 14, MM = 20, MAG = 21, MAJ = 22, IC = 30, JKS = 40, JKC = 41, JKG = 42, JKO = 43, JKB = 44, JKV = 45, JKQ = 46, JX = 47, JC = 48, EP = 50, EF = 51, EC = 52, ETN = 53, ETM = 54, XPN = 60, XSN = 61, XSV = 62, XSA = 63, XR = 64, SF = 70, SP = 71, SSO = 72, SSC = 73, SC = 74, SE = 75, SY = 76, SL = 77, SH = 78, SN = 79, Unknown = 99,
}
Expand description

품사 태그 (Part-of-Speech Tag)

21세기 세종계획 품사 태그 체계 + mecab-ko-dic 확장

§Example

use mecab_ko_core::pos_tag::PosTag;
use std::str::FromStr;

let tag = PosTag::from_str("NNG").unwrap();
assert_eq!(tag.as_str(), "NNG");
assert!(tag.is_content_word());

Variants§

§

NNG = 0

일반 명사 (General Noun) 예: 사과, 컴퓨터, 사랑, 학교

§

NNP = 1

고유 명사 (Proper Noun) 예: 서울, 세종대왕, 삼성, 한강

§

NNB = 2

의존 명사 (Dependent Noun) 예: 것, 수, 줄, 뿐, 데, 바

§

NNBC = 3

단위 의존 명사 (Counter/Unit Noun) mecab-ko-dic 확장 (세종 NNB에서 분리) 예: 개, 마리, 권, 명, 원

§

NP = 4

대명사 (Pronoun) 예: 나, 너, 우리, 이것, 저기

§

NR = 5

수사 (Numeral) 예: 하나, 둘, 첫째, 셋째

§

VV = 10

동사 (Verb) 예: 먹다, 가다, 하다, 되다

§

VA = 11

형용사 (Adjective) 예: 예쁘다, 크다, 좋다, 빠르다

§

VX = 12

보조 용언 (Auxiliary Predicate) 예: -아/어 있다, -고 싶다, -아/어 보다

§

VCP = 13

긍정 지정사 (Positive Copula) 예: 이다

§

VCN = 14

부정 지정사 (Negative Copula) 예: 아니다

§

MM = 20

관형사 (Determiner) 예: 새, 헌, 이, 그, 저, 모든

§

MAG = 21

일반 부사 (General Adverb) 예: 매우, 아주, 빨리, 천천히

§

MAJ = 22

접속 부사 (Conjunctive Adverb) 예: 그러나, 그리고, 따라서, 하지만

§

IC = 30

감탄사 (Interjection) 예: 아, 와, 어머나, 네, 예

§

JKS = 40

주격 조사 (Subjective Case Marker) 예: 이, 가

§

JKC = 41

보격 조사 (Complement Case Marker) 예: 이, 가 (되다/아니다 앞)

§

JKG = 42

관형격 조사 (Genitive Case Marker) 예: 의

§

JKO = 43

목적격 조사 (Objective Case Marker) 예: 을, 를

§

JKB = 44

부사격 조사 (Adverbial Case Marker) 예: 에, 에서, 로, 으로, 에게

§

JKV = 45

호격 조사 (Vocative Case Marker) 예: 아, 야, 이여

§

JKQ = 46

인용격 조사 (Quotative Case Marker) 예: 라고, 고

§

JX = 47

보조사 (Auxiliary Particle) 예: 은, 는, 도, 만, 까지, 조차

§

JC = 48

접속 조사 (Conjunctive Particle) 예: 와, 과, 하고

§

EP = 50

선어말 어미 (Pre-final Ending) 예: -시-, -었-, -겠-

§

EF = 51

종결 어미 (Final Ending) 예: -다, -ㄴ다, -니, -라

§

EC = 52

연결 어미 (Connective Ending) 예: -고, -면, -어서, -니까

§

ETN = 53

명사형 전성 어미 (Nominal Transformative Ending) 예: -ㅁ, -기

§

ETM = 54

관형형 전성 어미 (Adnominal Transformative Ending) 예: -ㄴ, -는, -ㄹ

§

XPN = 60

체언 접두사 (Noun Prefix) 예: 풋-, 맨-, 헛-, 순-

§

XSN = 61

명사파생 접미사 (Noun Derivational Suffix) 예: -님, -적, -화, -성

§

XSV = 62

동사파생 접미사 (Verb Derivational Suffix) 예: -하다, -되다, -시키다

§

XSA = 63

형용사파생 접미사 (Adjective Derivational Suffix) 예: -스럽다, -롭다, -답다

§

XR = 64

어근 (Root) 예: 꼼꼼, 달콤, 시큼

§

SF = 70

마침 부호 (Terminal Punctuation) 예: . ? !

§

SP = 71

공백 (Space)

§

SSO = 72

여는 괄호 (Opening Bracket) mecab-ko-dic 확장 (세종 SS에서 분리) 예: ( [ {

§

SSC = 73

닫는 괄호 (Closing Bracket) mecab-ko-dic 확장 (세종 SS에서 분리) 예: ) ] }

§

SC = 74

구분자 (Separator) mecab-ko-dic 확장 예: , ; :

§

SE = 75

줄임표 (Ellipsis) 예: …

§

SY = 76

기타 기호 (Other Symbol) 예: @ # $ % & *

§

SL = 77

외국어 (Foreign Language) 예: hello, computer, ABC

§

SH = 78

한자 (Hanja/Chinese Character) 예: 韓國, 大學, 文化

§

SN = 79

숫자 (Number) 예: 123, 45.6, 2024

§

Unknown = 99

미등록어 (Unknown Word) 사전에 없는 단어

Implementations§

Source§

impl PosTag

Source

pub const fn as_str(&self) -> &'static str

품사 태그 문자열 반환

Source

pub const fn korean_name(&self) -> &'static str

한글 명칭 반환

Source

pub const fn category(&self) -> PosCategory

품사 대분류 반환

Source

pub const fn is_content_word(&self) -> bool

내용어 여부 (검색 인덱싱에 유용)

명사, 동사, 형용사, 어근 등 의미를 담고 있는 형태소

Source

pub const fn is_function_word(&self) -> bool

기능어 여부

조사, 어미, 접사 등 문법적 기능을 담당하는 형태소

Source

pub const fn is_noun(&self) -> bool

명사 여부

Source

pub const fn is_predicate(&self) -> bool

용언 여부 (동사/형용사)

Source

pub const fn is_particle(&self) -> bool

조사 여부

Source

pub const fn is_ending(&self) -> bool

어미 여부

Source

pub const fn is_symbol(&self) -> bool

기호 여부

Source

pub const fn to_nori_compat(&self) -> NoriTag

Nori 호환 태그로 변환 (조사/어미 통합)

Source

pub const fn to_sejong_base(&self) -> PosTag

세종 기본 태그로 정규화

Source

pub const fn all() -> &'static [PosTag]

모든 태그 목록 반환

Trait Implementations§

Source§

impl Clone for PosTag

Source§

fn clone(&self) -> PosTag

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PosTag

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Display for PosTag

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl FromStr for PosTag

Source§

type Err = ParsePosTagError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<PosTag, <PosTag as FromStr>::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for PosTag

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for PosTag

Source§

fn eq(&self, other: &PosTag) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for PosTag

Source§

impl Eq for PosTag

Source§

impl StructuralPartialEq for PosTag

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.