after looking for a long time manually words in Spanish that have the five vowels in any order, for example Republicano, murcielago, superiora, etc; I'm bored and without success. I thought that mathematica could help me, by consulting the web I found that the DictionaryLookup command can be useful, the problem is, what pattern to use in that command to find all the words that meet the given condition ?. If anyone has any idea how to solve this problem it would be great to share their solution. Thanks in advance.


2 Answers 2

lst = DictionaryLookup[{"Spanish", 
    x__ /; And @@ (StringCount[x, #] == 1 & /@ {"a", "e", "i", "o", "u"})}];

Short @ lst

{abrenuncio, aceituno, acudidero, adoquier, << 447 >>, vomipurgante, vulnerario, yeguarizo, zurrapiento}

Length @ lst


  • $\begingroup$ Thank you very much for your help and for the time you have invested in finding that solution, but I still have a problem, the detail is that not all the words of the 15412 obtained with your code contain the five vowels at once. For example, zurrapiento if you have all at once, while zurriagazo not, because it lacks the E vowel, do not know if there is a way to filter the words of lst to achieve the goal? Or look for another method ?. $\endgroup$ Commented Mar 23, 2018 at 19:49
  • $\begingroup$ @bullitohappy, please see the new version. $\endgroup$
    – kglr
    Commented Mar 23, 2018 at 23:01
  • $\begingroup$ Thanks for your support, its what I was looking for. I did not think there were few words that met that condition $\endgroup$ Commented Mar 24, 2018 at 4:49
  • $\begingroup$ @bullitohappy, my pleasure. Thank you for the accept. $\endgroup$
    – kglr
    Commented Mar 24, 2018 at 5:14
  • 1
    $\begingroup$ If vowels with diacritics are included with StringCount[RemoveDiacritics@x, #], we find {abrenuncio,aceituno,acudidero,<<559>>,vulnerario,yeguarizo,zurrapiento}. $\endgroup$
    – creidhne
    Commented Jun 30, 2018 at 21:34
 ContainsAll[Characters[#], {"a", "e", "i", "o", "u"}] &]

If you need exactly one of each vowel (and in Spanish):

Select[DictionaryLookup[{"Spanish", ___} ], 
 StringCount[#, "a"] == StringCount[#, "e"] == StringCount[#, "i"] == 
   StringCount[#, "o"] == StringCount[#, "u"] == 1 &]

There are 455 such words:

"abrenuncio", "aceituno", "acudidero", "adoquier", ...

  • $\begingroup$ Thank to your answer I understood that it would be very difficult to find that 455 words. Also, I think is convenient read more about the StringCount command to use it later. Iam very sorry by not be able to.vote twice and also select you answer, but this is how this system works. I dont have more to thank you again. $\endgroup$ Commented Mar 24, 2018 at 5:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.