2
$\begingroup$

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.

$\endgroup$
7
$\begingroup$
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

455

$\endgroup$
  • $\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$ – bullitohappy Mar 23 '18 at 19:49
  • $\begingroup$ @bullitohappy, please see the new version. $\endgroup$ – kglr Mar 23 '18 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$ – bullitohappy Mar 24 '18 at 4:49
  • $\begingroup$ @bullitohappy, my pleasure. Thank you for the accept. $\endgroup$ – kglr Mar 24 '18 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 Jun 30 '18 at 21:34
2
$\begingroup$
Select[DictionaryLookup[], 
 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", ...

$\endgroup$
  • $\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$ – bullitohappy Mar 24 '18 at 5:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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