Skip to main content

A python binding for mecab-ko

Project description

python-mecab-ko

A python binding for mecab-ko

Help

See documentation for more details.

Installation

Using pip:

$ pip install python-mecab-ko

Usage

To perform morpheme analysis, you need to make a MeCab instance first:

>>> from mecab import MeCab
>>> mecab = MeCab()

To extract morphemes in a given sentence, use mecab.morphs():

>>> mecab.morphs('영등포구청역에 있는 맛집 좀 알려주세요.')
['영등포구청역', '에', '있', '는', '맛집', '좀', '알려', '주', '세요', '.']

To extract nouns in a given sentence, use mecab.nouns():

>>> mecab.nouns('우리나라에는 무릎 치료를 잘하는 정형외과가 없는가!')
['우리', '나라', '무릎', '치료', '정형외과']

To perform a morpheme analysis on a given sentence, use mecab.pos():

>>> mecab.pos('자연주의 쇼핑몰은 어떤 곳인가?')
[('자연주의', 'NNG'), ('쇼핑몰', 'NNG'), ('은', 'JX'), ('어떤', 'MM'), ('곳', 'NNG'), ('인가', 'VCP+EF'), ('?', 'SF')]

If you would like to obtain detailed morpheme analysis results, use mecab.parse():

>>> mecab.parse('즐거운 하루 보내세요!')
[
    Morpheme(span=Span(start=0, end=3), surface="즐거운",
             feature=Feature(
             pos="VA+ETM", semantic=None, has_jongseong=True, reading="즐거운",
             type="Inflect", start_pos="VA", end_pos="ETM", expression="즐겁/VA/*+ᆫ/ETM/*",
        ),
    ),
    Morpheme(span=Span(start=4, end=6), surface="하루",
             feature=Feature(
             pos="NNG", semantic=None, has_jongseong=False, reading="하루",
             type=None, start_pos=None, end_pos=None, expression=None,
        ),
    ),
    Morpheme(span=Span(start=7, end=9), surface="보내",
             feature=Feature(
             pos="VV", semantic=None, has_jongseong=False, reading="보내",
             type=None, start_pos=None, end_pos=None, expression=None,
        ),
    ),
    Morpheme(span=Span(start=9, end=11), surface="세요",
             feature=Feature(
             pos="EP+EF", semantic=None, has_jongseong=False, reading="세요",
             type="Inflect", start_pos="EP", end_pos="EF", expression="시/EP/*+어요/EF/*",
        ),
    ),
    Morpheme(span=Span(start=11, end=12), surface="!",
             feature=Feature(
             pos="SF", semantic=None, has_jongseong=None, reading=None,
             type=None, start_pos=None, end_pos=None, expression=None,
        ),
    ),
]

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

python_mecab_ko_py313-1.3.7-cp311-cp311-macosx_11_0_arm64.whl (179.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

python_mecab_ko_py313-1.3.7-cp310-cp310-win_arm64.whl (811.5 kB view details)

Uploaded CPython 3.10Windows ARM64

python_mecab_ko_py313-1.3.7-cp310-cp310-win_amd64.whl (672.3 kB view details)

Uploaded CPython 3.10Windows x86-64

python_mecab_ko_py313-1.3.7-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (607.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

python_mecab_ko_py313-1.3.7-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (564.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

python_mecab_ko_py313-1.3.7-cp310-cp310-macosx_11_0_arm64.whl (389.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file python_mecab_ko_py313-1.3.7-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for python_mecab_ko_py313-1.3.7-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b74d4c3654003d264645821ff71bdf49951ea6555fea22447dca1e3b821afb7c
MD5 e4155b6df3ee297205a11efdc414a76d
BLAKE2b-256 2f6248262d6506ff6aeef3d6f35552706fd4f4a7f431444131c52923118a0db5

See more details on using hashes here.

File details

Details for the file python_mecab_ko_py313-1.3.7-cp310-cp310-win_arm64.whl.

File metadata

File hashes

Hashes for python_mecab_ko_py313-1.3.7-cp310-cp310-win_arm64.whl
Algorithm Hash digest
SHA256 dfe90cd0515d7f21c95cd045831549e3fa6f374439647e3fed8a127846a37dc9
MD5 ff7d0944c61c8011901f581425a0d991
BLAKE2b-256 6fdf355f17730d4e72750bd75da3f0f3b405e9a8caadcd6f3a31293384fff514

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_mecab_ko_py313-1.3.7-cp310-cp310-win_arm64.whl:

Publisher: wheels.yml on XXXXRT666/python-mecab-ko

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_mecab_ko_py313-1.3.7-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for python_mecab_ko_py313-1.3.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f2a5ade9b92a265d3ee6fd1603a810bdadd0e1922b659a1e54823ba521265547
MD5 b7be699c83153284aa030160aadb4e54
BLAKE2b-256 964aac395233ef29c19fea440968ca493abfcb5ef578819f1bd1a72c369cce9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_mecab_ko_py313-1.3.7-cp310-cp310-win_amd64.whl:

Publisher: wheels.yml on XXXXRT666/python-mecab-ko

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_mecab_ko_py313-1.3.7-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_mecab_ko_py313-1.3.7-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f8718485cf31edfa1dec983479f95c13917f820726c10c597cc18334bfde04ff
MD5 9834c8b18c56458781247420b53d145b
BLAKE2b-256 8a8c7f6b3b47d35188059c49c54fea2b106f22e48454e51651e49278e6f23f2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_mecab_ko_py313-1.3.7-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on XXXXRT666/python-mecab-ko

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_mecab_ko_py313-1.3.7-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for python_mecab_ko_py313-1.3.7-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 89afbddf5b0d34f8b8291921ea13d6101b5a815d6c3fd6370d4361fbdec5caa8
MD5 15dbd6ffabcd230c951309f54411fc7f
BLAKE2b-256 01d1f0776c24a55ee7350769d23b40786e8279bcf18192a9c2176291343864e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_mecab_ko_py313-1.3.7-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl:

Publisher: wheels.yml on XXXXRT666/python-mecab-ko

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_mecab_ko_py313-1.3.7-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for python_mecab_ko_py313-1.3.7-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fead7de107d3f9139f6533352b07816bd7d68c354b369d912ac0d9da8cd82683
MD5 cb2ad8e46575d45065d86b76ec1d0375
BLAKE2b-256 8fd32da20bbfc5fd914c4a5790bf997095736fb9b23341733109da5705d864ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_mecab_ko_py313-1.3.7-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: wheels.yml on XXXXRT666/python-mecab-ko

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page