pemistahl / lingua-py

The most accurate natural language detection library for Python, suitable for short text and mixed-language text
Apache License 2.0
1.1k stars 44 forks source link

[feature request] add batch invoke #81

Closed newcworld closed 1 year ago

newcworld commented 1 year ago

can I invoke like this

detector.detect_language_of(["languages are awesome", "languages"])
pemistahl commented 1 year ago

No, I'm not planning to extend the API like this. I want to keep the API as simple as possible. You can achieve the same by using a list comprehension instead:

texts = ["languages are awesome", "languages"]
detected_languages = [detector.detect_language_of(text) for text in texts]