main content

detect language of text -凯发k8网页登录

detect language of text

since r2018b

description

use corpuslanguage to detect language of text.

the function supports english, japanese, german, and korean text.

example

language = corpuslanguage(str) detects the language of the text in str.

examples

detect the language of a string array of text.

str = [
    "恋の悩みで 苦しむ。"
    "空の星が輝きを増している。"];
language = corpuslanguage(str)
language = 
'ja'

input arguments

input text, specified as a string array, character vector, or cell array of character vectors.

example: ["an example of a short sentence."; "a second short sentence."]

data types: string | char | cell

output arguments

detected language, returned as one of the following:

  • 'en' – detected english text

  • 'ja' – detected japanese text

  • 'de' – detected german text

  • 'ko' – detected korean text

version history

introduced in r2018b

网站地图