Working with Linguistic Data in Mathematica

Written by on November 2, 2016 in Mathematica, Programming with 0 Comments

There are many interesting functions in Mathematica for working with language data, not just in English but in many other languages too.

The DictionaryLookup[] function is a good starting point. Let us see what languages are supported as part of dictionary lookup:

Supported Languages

Supported Languages

That is a good collection. It is nice to see that our National language Hindi is supported. Shall we try to get a glimpse of the words in the Hindi dictionary?

Hindi Words

Hindi Words

You can also see that 15983 Hindi words are available in the dictionary.

In contrast, the English dictionary contains a lot more number of words.

English Words

English Words Count

The documentation says that all forms of a word are included in the dictionary, i.e., no word stemming is done by default. So you will find the words “eat”, “eats” and “eating” in the dictionary.

Let us look for all English words that start with “lo” and end in “y”.

Some English Words

Some English Words

Another interesting function is Transliterate[]. You can use it to transliterate a string to plain ASCII or from one script to another.

Transliterate

Transliterate

WordTranslation[] is a very useful function. It gives word translations across many languages.

Word Translation

Word Translation

It is interesting to see that multiple Indian languages are supported by this function!

The function LanguageIdentify[] takes a string and guesses the corresponding language.

Identify the Language

Identify the Language

The last function we will look at is LanguageData[]. It takes a language and a property and returns the corresponding property value for that language.

Language Data

Language Data

Obviously, Wolfram guys have to work more on improving the Tamil script! But it is a good start.

From a developer’s perspective, it is indeed admirable that Mathematica attempts to support such diversity!

That is all for today. Hope you found the discussion interesting and useful. Thanks for your time!

Tags: , ,

Subscribe

If you enjoyed this article, subscribe now to receive more just like it.

Subscribe via RSS Feed

Leave a Reply

Your email address will not be published. Required fields are marked *

Top