Message Boards Message Boards

WordData[] outputs different "PhoneticForm"?

Posted 7 years ago

My app grabs random words from WordData[] and the words' IPA phonetic representations. A simplified version of the code looks like this:

data = {};
While[Length[data] < 4,
  try = RandomChoice[WordData[]];
  pho = WordData[try, "PhoneticForm"];
  If[Not[MissingQ[pho]] && StringLength[pho] > 4, 
   data = Append[data, {try, pho}]]];

This works quite well in the Wolfram Desktop. But when I turn the notebook into a cloud object (because the notebook serves as a resource file for my app), I get a simple transliteration version of the words instead of the IPA representation. That is not acceptable for my purposes.

In the Desktop: auction... ??k??n

In the Cloud: auction... 'okshuhn

Here is some code that isolates this problem, so you can reproduce it. Change the word "choice" to other words if you wish. What I get back from this input is {"t????s", "ch'ois"}. Same function, same input, different results.

locally = WordData["choice", "PhoneticForm"];
api = CloudDeploy[
   APIFunction[{"word" -> "String"}, 
    WordData[#word, "PhoneticForm"] &]];
fromAPI = URLExecute[api, {"word" -> "choice"}];
{locally, fromAPI}

My question is, can I somehow get the real IPA version of WordData[word,"PhoneticForm"] from a cloud object? I have tried converting the results of WordData[] with CharacterCode[], but that just encodes the 'okshuhn version. I kind of get why it happens, the IPA has symbols that are not ASCII, but still...

I'm using the Wolfram Desktop 11.0.1.0 on a Mac 10.10.5 (Yosemite), and I have a Developer's license for the Wolfram Developer Platform. I have tried other solutions involving Hold[] and FromEntity[], but so far, no luck. Can anyone help me with this, please?

Thanks in advance,

Mark Greenberg

POSTED BY: Mark Greenberg
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract