summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-15 04:02:57 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-15 04:02:57 +0000
commitb65cea8fefff9379e7085e936c4ead49dfe7ab56 (patch)
tree4944dda25d0ab668893581d04487359c31d7e2ea
parent251bf375853df8973d8e520b33f683bdd7c1ac71 (diff)
automatic import of python-articutapi
-rw-r--r--.gitignore1
-rw-r--r--python-articutapi.spec333
-rw-r--r--sources1
3 files changed, 335 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..2adbdd1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/ArticutAPI-1.3.0.tar.gz
diff --git a/python-articutapi.spec b/python-articutapi.spec
new file mode 100644
index 0000000..d677b5a
--- /dev/null
+++ b/python-articutapi.spec
@@ -0,0 +1,333 @@
+%global _empty_manifest_terminate_build 0
+Name: python-ArticutAPI
+Version: 1.3.0
+Release: 1
+Summary: Articut NLP system provides not only finest results on Chinese word segmentaion (CWS), Part-of-Speech tagging (POS) and Named Entity Recogintion tagging (NER), but also the fastest online API service in the NLP industry.
+License: MIT License
+URL: https://github.com/Droidtown/ArticutAPI
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/aa/e7/118ab68c228c9f95cdaf4d63bf25eea4c065d9ce4295a8510eba0895aac4/ArticutAPI-1.3.0.tar.gz
+BuildArch: noarch
+
+Requires: python3-requests
+Requires: python3-emoji
+Requires: python3-graphene
+
+%description
+# ArticutAPI
+## 安裝方法
+```sh
+pip3 install ArticutAPI
+```
+## 說明文件
+函數說明請參閱 Docs/index.html
+## 使用方法
+### Articut CWS (Chinese word segmentation)
+```
+from ArticutAPI import Articut
+from pprint import pprint
+username = "" #這裡填入您在 https://api.droidtown.co 使用的帳號 email。若使用空字串,則預設使用每小時 2000 字的公用額度。
+apikey = "" #這裡填入您在 https://api.droidtown.co 登入後取得的 api Key。若使用空字串,則預設使用每小時 2000 字的公用額度。
+articut = Articut(username, apikey)
+inputSTR = "會被大家盯上,才證明你有實力。"
+resultDICT = articut.parse(inputSTR)
+pprint(resultDICT)
+```
+### 回傳結果
+```
+{"exec_time": 0.06723856925964355,
+ "level": "lv2",
+ "msg": "Success!",
+ "result_pos": ["<MODAL>會</MODAL><ACTION_lightVerb>被</ACTION_lightVerb><ENTITY_nouny>大家</ENTITY_nouny><ACTION_verb>盯上</ACTION_verb>",
+ ",",
+ "<MODAL>才</MODAL><ACTION_verb>證明</ACTION_verb><ENTITY_pronoun>你</ENTITY_pronoun><ACTION_verb>有</ACTION_verb><ENTITY_noun>實力</ENTITY_noun>",
+ "。"],
+ "result_segmentation": "會/被/大家/盯上/,/才/證明/你/有/實力/。/",
+ "status": True,
+ "version": "v118",
+ "word_count_balance": 9985,
+ "product": "https://api.droidtown.co/product/",
+ "document": "https://api.droidtown.co/document/"
+}
+```
+### 列出斷詞結果所有詞性標記的內容詞 ###
+可以依需求找出「名詞」、「動詞」或是「形容詞」…等詞彙語意本身已經完整的詞彙。
+```
+inputSTR = "你計劃過地球人類補完計劃"
+resultDICT = articut.parse(inputSTR, level="lv1")
+pprint(resultDICT["result_pos"])
+#列出所有的 content word.
+contentWordLIST = articut.getContentWordLIST(resultDICT)
+pprint(contentWordLIST)
+#列出所有的 verb word. (動詞)
+verbStemLIST = articut.getVerbStemLIST(resultDICT)
+pprint(verbStemLIST)
+#列出所有的 noun word. (名詞)
+nounStemLIST = articut.getNounStemLIST(resultDICT)
+pprint(nounStemLIST)
+#列出所有的 location word. (地方名稱)
+locationStemLIST = articut.getLocationStemLIST(resultDICT)
+pprint(locationStemLIST)
+```
+### 回傳結果 ###
+```
+#resultDICT["result_pos"]
+["<ENTITY_pronoun>你</ENTITY_pronoun><ACTION_verb>計劃</ACTION_verb><ASPECT>過</ASPECT><LOCATION>地球</LOCATION><ENTITY_oov>人類</ENTITY_oov><ACTION_verb>補完</ACTION_verb><ENTITY_nounHead>計劃</ENTITY_nounHead>"]
+#列出所有的 content word.
+[[(177, 179, "計劃"), (144, 145, "補"), (116, 118, "人類"), (47, 49, "計劃")]]
+#列出所有的 verb word. (動詞)
+[[(41, 43, '計劃'), (111, 112, '補')]]
+#列出所有的 noun word. (名詞)
+[[(88, 90, '人類'), (138, 140, '計劃')]]
+#列出所有的 location word. (地方名稱)
+[[(62, 64, "地球")]]
+```
+### 取得 Articut 版本列表
+```
+resultDICT = articut.versions()
+pprint(resultDICT)
+```
+### 回傳結果
+```
+{"msg": "Success!",
+ "status": True,
+ "versions": [{"level": ["lv1", "lv2"],
+ "release_date": "2019-04-25",
+ "version": "latest"},
+ {"level": ["lv1", "lv2"],
+ "release_date": "2019-04-25",
+ "version": "v118"},
+ {"level": ["lv1", "lv2"],
+ "release_date": "2019-04-24",
+ "version": "v117"},...
+}
+
+%package -n python3-ArticutAPI
+Summary: Articut NLP system provides not only finest results on Chinese word segmentaion (CWS), Part-of-Speech tagging (POS) and Named Entity Recogintion tagging (NER), but also the fastest online API service in the NLP industry.
+Provides: python-ArticutAPI
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-ArticutAPI
+# ArticutAPI
+## 安裝方法
+```sh
+pip3 install ArticutAPI
+```
+## 說明文件
+函數說明請參閱 Docs/index.html
+## 使用方法
+### Articut CWS (Chinese word segmentation)
+```
+from ArticutAPI import Articut
+from pprint import pprint
+username = "" #這裡填入您在 https://api.droidtown.co 使用的帳號 email。若使用空字串,則預設使用每小時 2000 字的公用額度。
+apikey = "" #這裡填入您在 https://api.droidtown.co 登入後取得的 api Key。若使用空字串,則預設使用每小時 2000 字的公用額度。
+articut = Articut(username, apikey)
+inputSTR = "會被大家盯上,才證明你有實力。"
+resultDICT = articut.parse(inputSTR)
+pprint(resultDICT)
+```
+### 回傳結果
+```
+{"exec_time": 0.06723856925964355,
+ "level": "lv2",
+ "msg": "Success!",
+ "result_pos": ["<MODAL>會</MODAL><ACTION_lightVerb>被</ACTION_lightVerb><ENTITY_nouny>大家</ENTITY_nouny><ACTION_verb>盯上</ACTION_verb>",
+ ",",
+ "<MODAL>才</MODAL><ACTION_verb>證明</ACTION_verb><ENTITY_pronoun>你</ENTITY_pronoun><ACTION_verb>有</ACTION_verb><ENTITY_noun>實力</ENTITY_noun>",
+ "。"],
+ "result_segmentation": "會/被/大家/盯上/,/才/證明/你/有/實力/。/",
+ "status": True,
+ "version": "v118",
+ "word_count_balance": 9985,
+ "product": "https://api.droidtown.co/product/",
+ "document": "https://api.droidtown.co/document/"
+}
+```
+### 列出斷詞結果所有詞性標記的內容詞 ###
+可以依需求找出「名詞」、「動詞」或是「形容詞」…等詞彙語意本身已經完整的詞彙。
+```
+inputSTR = "你計劃過地球人類補完計劃"
+resultDICT = articut.parse(inputSTR, level="lv1")
+pprint(resultDICT["result_pos"])
+#列出所有的 content word.
+contentWordLIST = articut.getContentWordLIST(resultDICT)
+pprint(contentWordLIST)
+#列出所有的 verb word. (動詞)
+verbStemLIST = articut.getVerbStemLIST(resultDICT)
+pprint(verbStemLIST)
+#列出所有的 noun word. (名詞)
+nounStemLIST = articut.getNounStemLIST(resultDICT)
+pprint(nounStemLIST)
+#列出所有的 location word. (地方名稱)
+locationStemLIST = articut.getLocationStemLIST(resultDICT)
+pprint(locationStemLIST)
+```
+### 回傳結果 ###
+```
+#resultDICT["result_pos"]
+["<ENTITY_pronoun>你</ENTITY_pronoun><ACTION_verb>計劃</ACTION_verb><ASPECT>過</ASPECT><LOCATION>地球</LOCATION><ENTITY_oov>人類</ENTITY_oov><ACTION_verb>補完</ACTION_verb><ENTITY_nounHead>計劃</ENTITY_nounHead>"]
+#列出所有的 content word.
+[[(177, 179, "計劃"), (144, 145, "補"), (116, 118, "人類"), (47, 49, "計劃")]]
+#列出所有的 verb word. (動詞)
+[[(41, 43, '計劃'), (111, 112, '補')]]
+#列出所有的 noun word. (名詞)
+[[(88, 90, '人類'), (138, 140, '計劃')]]
+#列出所有的 location word. (地方名稱)
+[[(62, 64, "地球")]]
+```
+### 取得 Articut 版本列表
+```
+resultDICT = articut.versions()
+pprint(resultDICT)
+```
+### 回傳結果
+```
+{"msg": "Success!",
+ "status": True,
+ "versions": [{"level": ["lv1", "lv2"],
+ "release_date": "2019-04-25",
+ "version": "latest"},
+ {"level": ["lv1", "lv2"],
+ "release_date": "2019-04-25",
+ "version": "v118"},
+ {"level": ["lv1", "lv2"],
+ "release_date": "2019-04-24",
+ "version": "v117"},...
+}
+
+%package help
+Summary: Development documents and examples for ArticutAPI
+Provides: python3-ArticutAPI-doc
+%description help
+# ArticutAPI
+## 安裝方法
+```sh
+pip3 install ArticutAPI
+```
+## 說明文件
+函數說明請參閱 Docs/index.html
+## 使用方法
+### Articut CWS (Chinese word segmentation)
+```
+from ArticutAPI import Articut
+from pprint import pprint
+username = "" #這裡填入您在 https://api.droidtown.co 使用的帳號 email。若使用空字串,則預設使用每小時 2000 字的公用額度。
+apikey = "" #這裡填入您在 https://api.droidtown.co 登入後取得的 api Key。若使用空字串,則預設使用每小時 2000 字的公用額度。
+articut = Articut(username, apikey)
+inputSTR = "會被大家盯上,才證明你有實力。"
+resultDICT = articut.parse(inputSTR)
+pprint(resultDICT)
+```
+### 回傳結果
+```
+{"exec_time": 0.06723856925964355,
+ "level": "lv2",
+ "msg": "Success!",
+ "result_pos": ["<MODAL>會</MODAL><ACTION_lightVerb>被</ACTION_lightVerb><ENTITY_nouny>大家</ENTITY_nouny><ACTION_verb>盯上</ACTION_verb>",
+ ",",
+ "<MODAL>才</MODAL><ACTION_verb>證明</ACTION_verb><ENTITY_pronoun>你</ENTITY_pronoun><ACTION_verb>有</ACTION_verb><ENTITY_noun>實力</ENTITY_noun>",
+ "。"],
+ "result_segmentation": "會/被/大家/盯上/,/才/證明/你/有/實力/。/",
+ "status": True,
+ "version": "v118",
+ "word_count_balance": 9985,
+ "product": "https://api.droidtown.co/product/",
+ "document": "https://api.droidtown.co/document/"
+}
+```
+### 列出斷詞結果所有詞性標記的內容詞 ###
+可以依需求找出「名詞」、「動詞」或是「形容詞」…等詞彙語意本身已經完整的詞彙。
+```
+inputSTR = "你計劃過地球人類補完計劃"
+resultDICT = articut.parse(inputSTR, level="lv1")
+pprint(resultDICT["result_pos"])
+#列出所有的 content word.
+contentWordLIST = articut.getContentWordLIST(resultDICT)
+pprint(contentWordLIST)
+#列出所有的 verb word. (動詞)
+verbStemLIST = articut.getVerbStemLIST(resultDICT)
+pprint(verbStemLIST)
+#列出所有的 noun word. (名詞)
+nounStemLIST = articut.getNounStemLIST(resultDICT)
+pprint(nounStemLIST)
+#列出所有的 location word. (地方名稱)
+locationStemLIST = articut.getLocationStemLIST(resultDICT)
+pprint(locationStemLIST)
+```
+### 回傳結果 ###
+```
+#resultDICT["result_pos"]
+["<ENTITY_pronoun>你</ENTITY_pronoun><ACTION_verb>計劃</ACTION_verb><ASPECT>過</ASPECT><LOCATION>地球</LOCATION><ENTITY_oov>人類</ENTITY_oov><ACTION_verb>補完</ACTION_verb><ENTITY_nounHead>計劃</ENTITY_nounHead>"]
+#列出所有的 content word.
+[[(177, 179, "計劃"), (144, 145, "補"), (116, 118, "人類"), (47, 49, "計劃")]]
+#列出所有的 verb word. (動詞)
+[[(41, 43, '計劃'), (111, 112, '補')]]
+#列出所有的 noun word. (名詞)
+[[(88, 90, '人類'), (138, 140, '計劃')]]
+#列出所有的 location word. (地方名稱)
+[[(62, 64, "地球")]]
+```
+### 取得 Articut 版本列表
+```
+resultDICT = articut.versions()
+pprint(resultDICT)
+```
+### 回傳結果
+```
+{"msg": "Success!",
+ "status": True,
+ "versions": [{"level": ["lv1", "lv2"],
+ "release_date": "2019-04-25",
+ "version": "latest"},
+ {"level": ["lv1", "lv2"],
+ "release_date": "2019-04-25",
+ "version": "v118"},
+ {"level": ["lv1", "lv2"],
+ "release_date": "2019-04-24",
+ "version": "v117"},...
+}
+
+%prep
+%autosetup -n ArticutAPI-1.3.0
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-ArticutAPI -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon May 15 2023 Python_Bot <Python_Bot@openeuler.org> - 1.3.0-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..836c936
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+c6e416ba1c3c2ac86cd496f239e0d53c ArticutAPI-1.3.0.tar.gz