{"id":16654910,"url":"https://github.com/kensuke-mitsuzawa/knp_python_parser","last_synced_at":"2026-04-24T17:05:46.885Z","repository":{"id":151020459,"uuid":"8269252","full_name":"Kensuke-Mitsuzawa/KNP_Python_Parser","owner":"Kensuke-Mitsuzawa","description":"Parser for result of KNP written by Python ","archived":false,"fork":false,"pushed_at":"2013-02-18T23:13:12.000Z","size":201,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-19T11:30:26.166Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kensuke-Mitsuzawa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-18T13:51:10.000Z","updated_at":"2017-10-27T17:37:23.000Z","dependencies_parsed_at":"2023-04-05T03:37:04.319Z","dependency_job_id":null,"html_url":"https://github.com/Kensuke-Mitsuzawa/KNP_Python_Parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kensuke-Mitsuzawa%2FKNP_Python_Parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kensuke-Mitsuzawa%2FKNP_Python_Parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kensuke-Mitsuzawa%2FKNP_Python_Parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kensuke-Mitsuzawa%2FKNP_Python_Parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kensuke-Mitsuzawa","download_url":"https://codeload.github.com/Kensuke-Mitsuzawa/KNP_Python_Parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243270096,"owners_count":20264213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T09:51:28.152Z","updated_at":"2026-04-24T17:05:46.879Z","avatar_url":"https://github.com/Kensuke-Mitsuzawa.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KNP Parser written by Python\n\n***\n####概要\nKNPは日本語解析器なので、日本語で書きます。\n日本語解析器のKNPの結果を見やすいように整形＋必要（と思われる）情報を取って来てくれるスクリプトです。KNPの-tabオプションを利用しています。\n \n別の目的で作成していたので、コードの内容は荒書きですが、動きます。\n\n***\n\n####必要な物\n\njuman **JUMAN Ver.7.0**   \n\u003chttp://nlp.ist.i.kyoto-u.ac.jp/index.php?cmd=read\u0026page=JUMAN\u0026alias%5B%5D=%E6%97%A5%E6%9C%AC%E8%AA%9E%E5%BD%A2%E6%85%8B%E7%B4%A0%E8%A7%A3%E6%9E%90%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0JUMAN\u003e\n\nKNP **KNP Ver.4.0.1**   \n \u003chttp://nlp.ist.i.kyoto-u.ac.jp/index.php?KNP\u003e\n\n古いバージョンのjumanだと文字コードの都合上、動作しません。\n\n***\n####動かし方\n\nKNPやJUMANを標準とは違う所にインストールした場合\n\nmain.pyの１０１行目〜１０７行目の部分を書き換えてください。\n書き換え先は自分の環境でKNPとJUMANのパスが通っている所です。\n\n例:/usr/local/binにjumanのパスが通っている場合   \n    juman = subprocess.Popen(['/usr/local/bin/juman'],   \nに書き換える。\n\n***\n####使い方\n\npython main.py\n\nを実行すると、日本語を打つように言うので、日本語打ってください。\n\n***\n####見方\n\n例えば「私は朝、運動をします。」と入力すると、下の様に表示されます。\n\n\u003cpre\u003e\u003ccode\u003e\n私は朝、運動に出かける。\n-----------------------------\nNumber of Clauses is 4\nList of lines in each clause [4, 4, 4, 3]\nAbout OutPut list\nContents of list is: [\u003csyori.info instance at 0x10d581b00\u003e, \u003csyori.info instance at 0x10d581b48\u003e, \u003csyori.info instance at 0x10d581b90\u003e, \u003csyori.info instance at 0x10d581bd8\u003e]\n---------------------------------------\ninput_morpheme is: 私\nregular morpheme is: 私\npos is: 名詞\ntense is: []\nbnst clause type is: \nkihon clause type is: \nkihon next dependenct number: 3\nkihon position number: 0\nkihon clause function is: \nmofifier or not: \ncase or not: yes\nmain case is: \nmain: yes\npredicate or not: \nkaiseki case: ガ\ncase relation is: []\npara_check is: \npara range(kihon pharase) is: []\npara range(clause) is \n*note* includes this node and dependent node: []\npara type is: []\ncounter check(kihon) \ncounter type(kihon) \n---------------------------------------\ninput_morpheme is: 朝\nregular morpheme is: 朝\npos is: 名詞\ntense is: []\nbnst clause type is: \nkihon clause type is: \nkihon next dependenct number: 3\nkihon position number: 1\nkihon clause function is: \nmofifier or not: \ncase or not: yes\nmain case is: \nmain: \npredicate or not: \nkaiseki case: 時間\ncase relation is: []\npara_check is: yes\npara range(kihon pharase) is: \npara range(clause) is \n*note* includes this node and dependent node: \npara type is: ？\ncounter check(kihon) \ncounter type(kihon) \n---------------------------------------\ninput_morpheme is: 運動\nregular morpheme is: 運動\npos is: 名詞\ntense is: []\nbnst clause type is: 連用節\nkihon clause type is: 連用節\nkihon next dependenct number: 3\nkihon position number: 2\nkihon clause function is: \nmofifier or not: \ncase or not: \nmain case is: \nmain: \npredicate or not: yes\nkaiseki case: []\ncase relation is: ['\\xe6\\x99\\x82\\xe9\\x96\\x93:\\xe6\\x9c\\x9d']\n時間:朝\npara_check is: \npara range(kihon pharase) is: []\npara range(clause) is \n*note* includes this node and dependent node: []\npara type is: []\ncounter check(kihon) \ncounter type(kihon) \n---------------------------------------\ninput_morpheme is: 出かける\nregular morpheme is: 出かける\npos is: 動詞\ntense is: 未来\nbnst clause type is: 主節\nkihon clause type is: 主節\nkihon next dependenct number: -1\nkihon position number: 3\nkihon clause function is: \nmofifier or not: \ncase or not: yes\nmain case is: 一人称優位\nmain: \npredicate or not: yes\nkaiseki case: []\ncase relation is: ['\\xe3\\x82\\xac:\\xe7\\xa7\\x81']\nガ:私\npara_check is: \npara range(kihon pharase) is: []\npara range(clause) is \n*note* includes this node and dependent node: []\npara type is: []\ncounter check(kihon) \ncounter type(kihon) \n\u003c/code\u003e\u003c/pre\u003e\n\nと表示されます。  \n\n\u003cpre\u003e\u003ccode\u003e\n-----------------------------\nNumber of Clauses is 4\nList of lines in each clause [4, 4, 4, 3]\nAbout OutPut list\nContents of list is: [\u003csyori.info instance at 0x10d581b00\u003e, \u003csyori.info instance at 0x10d581b48\u003e, \u003csyori.info instance at 0x10d581b90\u003e, \u003csyori.info instance at 0x10d581bd8\u003e]\n---------------------------------------\n\u003c/code\u003e\u003c/pre\u003e\n\nNumber of Clauses is  :文節数を示します。  \nList of lines in each clause :KNP -tabオプションを何行ごとに区切るのか？をしめしています。  \nContents of list is: 各句をインスタンスとして保存して、リストに格納します。その結果を表示しています。   \n\n各句に関する情報は以下の通りです。    \n\u003cpre\u003e\u003ccode\u003e\ninput_morpheme is: 私\nregular morpheme is: 私\npos is: 名詞\ntense is: []\nbnst clause type is: \nkihon clause type is: \nkihon next dependenct number: 3\nkihon position number: 0\nkihon clause function is: \nmofifier or not: \ncase or not: yes\nmain case is: \nmain: yes\npredicate or not: \nkaiseki case: ガ\ncase relation is: []\npara_check is: \npara range(kihon pharase) is: []\npara range(clause) is \n*note* includes this node and dependent node: []\npara type is: []\ncounter check(kihon) \ncounter type(kihon) \n\u003c/code\u003e\u003c/pre\u003e\n\ninput_morpheme:入力されたままの形態素が表示されます   \nregular_morpheme:正規化された形態素が表示されます   \npos:品詞が表示されます\ntense:動詞の場合、時制が表示   \nbnst clause type:文節の機能を表示   \nkihon caluse type:基本句の機能を表示（大体は文節の機能と同じ）   \nkihon next dependent number:基本句が次にかかるのは何番目の句か？    \nkihon position number:基本句の番号   \nmodifier or not:修飾語かどうか   \ncase or not:格かどうか        \nmain case is:（基本句が述語のときのみ）主格は何か？    \nmain:（基本句が）主格かどうか？    \npredicate or not:述語かどうか？    \nkaiseki case:（格の場合）何格の役割か？     \ncase relation is:（述語の時）他の格との関係    \npara_check:並列のチェック    \npara range(kihon pharase) is:（基本句単位で）何句にわたって並列しているか？   \npara range(clause) is \n*note* includes this node and dependent node:（文節単位で）何句にわたって並列しているか？    \npara type is:並列のタイプは何か？     \ncounter check(kihon):数詞の場合にチェックが入る     \ncounter type(kihon) :数詞はどのタイプか？   \n\n\n*述語や修飾語や格の取り扱いは益岡文法体系によります。\n\n***\n####コードの挙動\n\n上の様に１句ずつ情報を取得して、インスタンスとします。そして、リストに格納します。out_listがそのリストです。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkensuke-mitsuzawa%2Fknp_python_parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkensuke-mitsuzawa%2Fknp_python_parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkensuke-mitsuzawa%2Fknp_python_parser/lists"}