Here are some examples of linguistic analyses using MeaningCloud:
To show how to carry out a syntactic analysis extracting topics we will use the following text as an example:
"Robert Downey Jr has topped Forbes magazine's annual list of the highest paid actors for the second year in a row."
txt
parameter to submit the text.lang
the language in which the text is going to be analyzed, in this case English, en.key
parameter.of
.uw
so the engine tries to find possible analysis when there are typos in the text.tt
with the value eto obtain the entities detected in the text in the corresponding token.curl
:curl 'http://api.meaningcloud.com/parser-2.0' \
--form 'key=YOUR API KEY' \
--form 'lang=en' \
--form 'txt=Robert Downey Jr has topped Forbes magazines annual list of the highest paid actors for the second year in a row.' \
--form 'uw=y' \
--form 'tt=e'
To show how to work with the output to obtain the morphological analysis of a sentence we will use the following text as an example:
"Robert Downey Jr has topped Forbes magazine's annual list of the highest paid actors for the second year in a row."
We will:
txt
parameter to submit the text.lang
the language in which the text is going to be analyzed, in this case English, en.key
parameter.of
.verbose
parameter to obtain the morphological tag explained.The following code contains a request to the API using this parameters, and processes the output to obtain an array (morpho) with the tokens with the morphological analysis. After that we will print them
php parser-2.0-gist-morpho.php
And this will be the output for the example sentence:To show how to work with the output to lemmatize a sentence we will use the following text as an example:
"Robert Downey Jr has topped Forbes magazine's annual list of the highest paid actors for the second year in a row."
We will:
txt
parameter to submit the text.lang
the language in which the text is going to be analyzed, in this case English, en.key
parameter.of
.The following code contains a request to the API using this parameters, and processes the output to obtain an array (morpho) with the tokens with the morphological analysis. After that we will print them
php parser-2.0-gist-lemma.php
Tokens:
=============
{{{{Robert Downey Jr|Robert Downey Jr|Robert Downey Jr|Robert Downey Jr|Robert Downey Jr}}{has topped|top}{{{Forbes|Forbes|Forbes|Forbes|Forbes}{magazine|magazine}}{'s|'s}{{annual|annual}{list|list}{{of|of}{{the|the}{highest|high}{paid|pay}{actors|actor}{{for|for}{{the|the}{second|second}{year|year}}}}}}}{{{in|in}{{a|a}{row|row}}}}{.|.}}