Skip to main content

EHowNet Utilities

Project description

Official E-HowNet Utilities

Introduction

Author

Requirements

Installation

pip install ehownet -U

Usage

E-HowNet Parser

CLI

# Usage
ehn-parser <text> [<text> ...]

# Example
ehn-parser \
   "{MusicTool|樂器_x:predication={own|有:possession={按鈕|PushingButton:whole={x}}}}" \
   "{InstitutePlace|場所:telic={or({experiment|實驗:location={~}},{research|研究:location={~}})}}"

Output:

#1
[Entity $x] MusicTool|樂器
└── [Feature] predication
    └── [Entity] own|有
        └── [Feature] possession
            └── [Entity] 按鈕|PushingButton
                └── [Feature] whole
                    └── $x

#2
[Entity] InstitutePlace|場所
└── [Feature] telic
    └── [Entity]
        └── [Function] or
            ├── [Entity] experiment|實驗
            │   └── [Feature] location
            │       └── [TildeEntity]
            └── [Entity] research|研究
                └── [Feature] location
                    └── [TildeEntity]

Python API

from ehn.parse import EhnParser

text = '{MusicTool|樂器_x:predication={own|有:possession={按鈕|PushingButton:whole={x}}}}'

parser = EhnParser()
ress = parser(text, debug=False)
for res in ress:
   print(res)

Output:

[Entity $x] MusicTool|樂器
└── [Feature] predication
    └── [Entity] own|有
        └── [Feature] possession
            └── [Entity] 按鈕|PushingButton
                └── [Feature] whole
                    └── $x

License

CC BY-NC-SA 4.0

Copyright (c) 2019 Mu Yang under the CC-BY-NC-SA 4.0 License. All rights reserved.

Project details


Download files

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

Files for ehownet, version 0.2.0.post1
Filename, size File type Python version Upload date Hashes
Filename, size ehownet-0.2.0.post1.tar.gz (7.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page