File tree Expand file tree Collapse file tree 10 files changed +21
-12
lines changed Expand file tree Collapse file tree 10 files changed +21
-12
lines changed Original file line number Diff line number Diff line change 7474 conda install -c conda-forge icu
7575 conda install -c conda-forge pyicu
7676 if [ -f docker_requirements.txt ]; then pip install -r docker_requirements.txt; fi
77- pip install deepcut
77+ pip install deepcut tltk
7878 pip install .[full]
7979 python -m nltk.downloader omw-1.4
8080 if : matrix.os != 'self-hosted'
Original file line number Diff line number Diff line change 2121 - name : Install dependencies
2222 run : |
2323 python -m pip install --upgrade pip
24- pip install deepcut
24+ pip install deepcut tltk
2525 pip install -r https://raw.githubusercontent.com/PyThaiNLP/pythainlp/dev/docker_requirements.txt
2626 pip install pythainlp[full]
2727 python -m nltk.downloader omw-1.4
Original file line number Diff line number Diff line change 3131 python -m pip install --upgrade pip
3232 pip install pytest coverage coveralls
3333 if [ -f docker_requirements.txt ]; then pip install -r docker_requirements.txt; fi
34- pip install deepcut
34+ pip install deepcut tltk
3535 pip install .[full]
3636 python -m nltk.downloader omw-1.4
3737 - name : Test
Original file line number Diff line number Diff line change 5151 python -m pip install -r docker_requirements.txt
5252 python -m pip install .[full]
5353 python -m nltk.downloader omw-1.4
54- python -m pip install spacy deepcut
54+ python -m pip install spacy deepcut tltk
5555 - name : Test
5656 shell : powershell
5757 env :
Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ where ``extras`` can be
2828 - ``wordnet `` (to support wordnet)
2929 - ``spell `` (to support phunspell & symspellpy)
3030 - ``generate `` (to support text generate with umlfit or thai2fit)
31- - ``tltk `` (to support tltk)
3231 - ``textaugment `` (to support text augmentation)
3332 - ``oskut `` (to support OSKUT)
3433 - ``nlpo3 `` (to support nlpo3 engine)
Original file line number Diff line number Diff line change 2121 * \
2222 https://pypi.org/project/tltk/
2323"""
24- from tltk .nlp import spell_candidates
24+ try :
25+ from tltk .nlp import spell_candidates
26+ except ImportError :
27+ raise ImportError ("Not found tltk! Please install tltk by pip install tltk" )
2528from typing import List
2629
2730
Original file line number Diff line number Diff line change 1313# See the License for the specific language governing permissions and
1414# limitations under the License.
1515from typing import List , Tuple , Union
16- from tltk import nlp
16+ try :
17+ from tltk import nlp
18+ except ImportError :
19+ raise ImportError ("Not found tltk! Please install tltk by pip install tltk" )
1720from pythainlp .tokenize import word_tokenize
1821
1922nlp .pos_load ()
Original file line number Diff line number Diff line change 1313# See the License for the specific language governing permissions and
1414# limitations under the License.
1515from typing import List
16- from tltk .nlp import word_segment as tltk_segment
17- from tltk .nlp import syl_segment
16+ try :
17+ from tltk .nlp import word_segment as tltk_segment
18+ from tltk .nlp import syl_segment
19+ except ImportError :
20+ raise ImportError ("Not found tltk! Please install tltk by pip install tltk" )
1821
1922
2023def segment (text : str ) -> List [str ]:
Original file line number Diff line number Diff line change 1212# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313# See the License for the specific language governing permissions and
1414# limitations under the License.
15- from tltk .nlp import g2p , th2ipa , th2roman
15+ try :
16+ from tltk .nlp import g2p , th2ipa , th2roman
17+ except ImportError :
18+ raise ImportError ("Not found tltk! Please install tltk by pip install tltk" )
1619
1720
1821def romanize (text : str ) -> str :
Original file line number Diff line number Diff line change 8686 "spylls>=0.1.5" ,
8787 "symspellpy>=6.7.6"
8888 ],
89- "tltk" : ["tltk>=1.3.8" ],
9089 "oskut" : ["oskut>=1.3" ],
9190 "nlpo3" : ["nlpo3>=1.2.2" ],
9291 "onnx" : [
132131 "phunspell>=0.1.6" ,
133132 "spylls>=0.1.5" ,
134133 "symspellpy>=6.7.6" ,
135- "tltk>=1.3.8" ,
136134 "oskut>=1.3" ,
137135 "nlpo3>=1.2.2" ,
138136 "onnxruntime>=1.10.0" ,
You can’t perform that action at this time.
0 commit comments