Language Detection
Language Detection
A very elementary function of the Extractor is to detect the language of a piece of text. The method name is "detectLanguage" and the parameter is "text".
We will use the following example text in English:
A Spritz Veneziano also called just Spritz or just Veneziano, is an Italian wine-based cocktail, commonly served as an aperitif in northeast Italy. The drink originated in Venice while it was part of the Austrian Empire, and is based on the Austrian Spritzer, a combination of equal parts white wine and soda water.
Use the following call:
Request
{{url}}/extractor/api/detectLanguage?text=A Spritz Veneziano also called just Spritz or just Veneziano, is an Italian wine-based cocktail, commonly served as an aperitif in northeast Italy. The drink originated in Venice while it was part of the Austrian Empire, and is based on the Austrian Spritzer, a combination of equal parts white wine and soda water.
This produces the following result:
Results
"en"
Detection of a Korean Text
The Extractor can also detect the language for texts that use characters differing from English, such as Korean:
스프리츠(Spritz)는 이탈리아의 와인을 베이스로한 칵테일이다. 북부 지방에서 주로 애용되며, 프로세코와 탄산수를 이용하여 만든다.
Request:
Request
{{url}}/extractor/api/detectLanguage?text=스프리츠(Spritz)는 이탈리아의 와인을 베이스로한 칵테일이다. 북부 지방에서 주로 애용되며, 프로세코와 탄산수를 이용하여 만든다.
Result:
Results
"ko"
Detection of a Hebrew Text
This a text example in Hebrew:
שפריץ (Spritz) הוא קוקטייל אלכוהולי ששורשיו במחוז ונטו שבאיטליה. זהו אפריטיף, אשר עשוי בגירסתו הנפוצה מפרוסקו מעורבב עם אפרול ומי סודה.
Request:
Request
{{url}}/extractor/api/detectLanguage?text=שפריץ (Spritz) הוא קוקטייל אלכוהולי ששורשיו במחוז ונטו שבאיטליה. זהו אפריטיף, אשר עשוי בגירסתו הנפוצה מפרוסקו מעורבב עם אפרול ומי סודה.
Result:
Results
"he"