Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit dace7d8

Browse files
committed
Rename language.py to textcheck.py
Using "language.py" led to confusion about whether we're dealing with code or human languages. I got tired of thinking about it, and decided to rename it to "textcheck.py".
1 parent 4fe35d0 commit dace7d8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

bin/whatlang

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import sys
1515
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
1616

1717
import codeornot
18-
from codeornot import language
18+
from codeornot import textcheck
1919

2020
@plac.annotations(
2121
debug = ('drop into ipdb after parsing', 'flag', 'd'),
@@ -54,16 +54,16 @@ the language of the text.'''
5454
text = input
5555

5656
# Test input length and return a meaningful message if it's too short.
57-
if len(text) < language.min_length():
57+
if len(text) < textcheck.min_length():
5858
print('Text needs to be at least {} characters long for analysis'
59-
.format(language.min_length()))
59+
.format(textcheck.min_length()))
6060
sys.exit(1)
6161

6262
# Analyze the text and return the results.
63-
lang = language.majority_language(text, enforce_length=True)
63+
lang = textcheck.majority_language(text, enforce_length=True)
6464
if lang and len(lang) > 0:
6565
print('Best guess at language used in {}: {} ({})'
66-
.format(input_type, lang, language.iso639_to_name(lang)))
66+
.format(input_type, lang, textcheck.iso639_to_name(lang)))
6767
if debug:
6868
import ipdb; ipdb.set_trace()
6969

codeornot/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
# =============================================================================
88

99
from .__version__ import *
10-
from .language import human_language, majority_language
10+
from .textcheck import human_language, majority_language

0 commit comments

Comments
 (0)