Message Boards Message Boards

Wolfram Language for Motivational Words

Posted 9 years ago

When I saw this picture on Linkedin I thought: "What are the other 100 points words?"

enter image description here

Well, pretty easy with WL, using just 3 lines of code. First let's create our wordValue function:

index = First/@PositionIndex@CharacterRange["a","z"];
wordValue[word_String]:= Total[Lookup[index, #, 0]&/@StringPartition[ToLowerCase@RemoveDiacritics@word,1]]

Testing the code we have:

wordValue/@{"knowledge", "hardwork", "attitude"}
{96, 98, 100}

Great, the check is ok! Now what are the other words? One more line:

words100 = Select[DictionaryLookup[], wordValue[#]==100&]

Now, take care with "useless and inefficient elephants" in your company, these are 100 points words!

wordValue/@{"useless", "inefficient", "elephants"}
{100, 100, 100}

Here is a Word Cloud with a sample of 100 words from the total of 1054:

WordCloud[RandomSample[words100, 100], WordOrientation -> "Random"]

enter image description here

POSTED BY: Rodrigo Murta
8 Replies

enter image description here - another post of yours has been selected for the Staff Picks group, congratulations !

We are happy to see you at the tops of the "Featured Contributor" board. Thank you for your wonderful contributions, and please keep them coming!

POSTED BY: Moderation Team
Posted 8 years ago
POSTED BY: Amalie Jenner

Very nice results! Cool stuff! Your wordvalue is fast, but looks very convoluted!

I came up with two ways:

rules = Dispatch[# -> LetterNumber[#] & /@ Alphabet[]]
wordvalue2[word_String] := Total[Characters[ToLowerCase@RemoveDiacritics@word] /. rules]
wordvalue3[word_String] := Plus @@ LetterNumber@ToLowerCase@RemoveDiacritics@word

Note that I do Plus@@ rather than Total@ in order to deal with 1 letter words...

In your version you could replace StringPartition[...,1] by Characters.

POSTED BY: Sander Huisman

By the way, @Rodrigo Murta, the new function LetterNumber would make things easier:

LetterNumber["?", "Greek"]
(* 11 *)
POSTED BY: Vitaliy Kaurov
POSTED BY: Vitaliy Kaurov
Posted 8 years ago

That's very cool Vitaliy, how did you make that graph by the way?

POSTED BY: Mike Spring
POSTED BY: Daniel Carvalho

Hi @Daniel Interesting this Google API for search. Tks for sharing!

POSTED BY: Rodrigo Murta
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