Skip to content

Commit 2b5cfe3

Browse files
committed
chg: [language] replace lexilang by ail-project picolang
1 parent b74bd75 commit 2b5cfe3

3 files changed

Lines changed: 10 additions & 11 deletions

File tree

bin/lib/Language.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import html2text
1010

1111
import gcld3
12-
from lexilang.detector import detect as lexilang_detect
12+
from picolang.detector import detect as picolang_detect
1313
from libretranslatepy import LibreTranslateAPI
1414

1515
sys.path.append(os.environ['AIL_BIN'])
@@ -242,7 +242,7 @@ def create_dict_iso_languages():
242242
'sn': 'sna',
243243
'so': 'som',
244244
'sq': 'sqi',
245-
'sr': 'hbs', # Lexilang invalid use of sr. Should se deprecated sh
245+
'sr': 'hbs', # picolang invalid use of sr. Should se deprecated sh
246246
'st': 'sot',
247247
'su': 'sun',
248248
'sv': 'swe',
@@ -625,8 +625,8 @@ def detect_gcld3(self, content):
625625
languages.append(lang.language)
626626
return languages
627627

628-
def detect_lexilang(self, content):
629-
language, prob = lexilang_detect(content)
628+
def detect_picolang(self, content):
629+
language, prob = picolang_detect(content)
630630
# print(language, prob)
631631
if prob > 0 and self.min_probability == -1:
632632
return [language]
@@ -646,10 +646,10 @@ def detect(self, content, force_gcld3=False, iso3=True): # TODO detect length b
646646
# print('-------------------------------------------------------')
647647
# print(content)
648648
# print(len(content))
649-
# lexilang
649+
# picolang
650650
if len(content) < 150:
651-
# print('lexilang')
652-
languages = self.detect_lexilang(content)
651+
# print('picolang')
652+
languages = self.detect_picolang(content)
653653
# gcld3
654654
else:
655655
languages = self.detect_gcld3(content)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ scrapy-splash>=0.7.2
4646
# Languages
4747
gcld3
4848
libretranslatepy
49-
git+https://github.com/ail-project/LexiLang
49+
picolang
5050

5151
# Demoji
5252
git+https://github.com/ail-project/demoji

update/v6.7/Update.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ git submodule update
2323
bash ${AIL_BIN}/LAUNCH.sh -lrv
2424
bash ${AIL_BIN}/LAUNCH.sh -lkv
2525

26-
echo -e $GREEN"Updating python Lexilang..."$DEFAULT
27-
pip uninstall -y lexilang
28-
pip install -U git+https://github.com/ail-project/LexiLang
26+
echo -e $GREEN"Installing python picolang..."$DEFAULT
27+
pip install -U picolang
2928

3029
echo -e $GREEN"Updating python pyail."$DEFAULT
3130
pip install -U pyail

0 commit comments

Comments
 (0)