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
$\begingroup$
$\endgroup$
5
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
-
$\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$– kglrCommented 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$– kglrCommented 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$– creidhneCommented Jun 30, 2018 at 21:34
$\begingroup$
$\endgroup$
1
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", ...
-
$\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