5 added 1464 characters in body
source | link

Here are the results for the First Act, up to Horatio's speech starting "That can I..."

  {{"th", 65}, {"to", 23}, {"of", 22}, {"an", 21}, {"no", 14}, {"st", 
  12}, {"ha", 12}, {"yo", 11}, {"ni", 10}, {"it", 10}, {"he", 
  10}, {"so", 9}, {"ma", 9}, {"be", 9}, {"sp", 8}, {"wa", 7}, {"ki", 
  7}, {"co", 7}, {"wh", 6}, {"on", 6}, {"li", 6}, {"hi", 6}, {"go", 
  6}, {"wi", 5}, {"we", 5}, {"us", 5}, {"tw", 5}, {"se", 5}, {"ou", 
  5}, {"my", 5}, {"mo", 5}, {"ho", 5}, {"ca", 5}, {"ar", 5}, {"ag", 
  5}, {"si", 4}, {"sa", 4}, {"pa", 4}, {"mi", 4}, {"me", 4}, {"fr", 
  4}, {"fo", 4}, {"fa", 4}, {"do", 4}, {"ap", 4}, {"wo", 3}, {"ti", 
  3}, {"su", 3}, {"lo", 3}, {"le", 3}, {"la", 3}, {"is", 3}, {"in", 
  3}, {"gr", 3}, {"da", 3}, {"ch", 3}, {"bu", 3}, {"at", 3}, {"tr", 
  2}, {"ta", 2}, {"sc", 2}, {"re", 2}, {"qu", 2}, {"pr", 2}, {"po", 
  2}, {"pl", 2}, {"ne", 2}, {"kn", 2}, {"im", 2}, {"ey", 2}, {"di", 
  2}, {"de", 2}, {"by", 2}, {"br", 2}, {"bi", 2}, {"aw", 2}, {"am", 
  2}, {"al", 2}, {"ve", 1}, {"up", 1}, {"un", 1}, {"tu", 1}, {"te", 
  1}, {"sw", 1}, {"sm", 1}, {"sl", 1}, {"sh", 1}, {"ri", 1}, {"pi", 
  1}, {"ow", 1}, {"ot", 1}, {"op", 1}, {"ob", 1}, {"mu", 1}, {"ju", 
  1}, {"jo", 1}, {"il", 1}, {"if", 1}, {"ic", 1}, {"gu", 1}, {"ge", 
  1}, {"fi", 1}, {"fe", 1}, {"er", 1}, {"en", 1}, {"ea", 1}, {"dr", 
  1}, {"bo", 1}, {"av", 1}, {"as", 1}}

Here are the results for the First Act, up to Horatio's speech starting "That can I..."

  {{"th", 65}, {"to", 23}, {"of", 22}, {"an", 21}, {"no", 14}, {"st", 
  12}, {"ha", 12}, {"yo", 11}, {"ni", 10}, {"it", 10}, {"he", 
  10}, {"so", 9}, {"ma", 9}, {"be", 9}, {"sp", 8}, {"wa", 7}, {"ki", 
  7}, {"co", 7}, {"wh", 6}, {"on", 6}, {"li", 6}, {"hi", 6}, {"go", 
  6}, {"wi", 5}, {"we", 5}, {"us", 5}, {"tw", 5}, {"se", 5}, {"ou", 
  5}, {"my", 5}, {"mo", 5}, {"ho", 5}, {"ca", 5}, {"ar", 5}, {"ag", 
  5}, {"si", 4}, {"sa", 4}, {"pa", 4}, {"mi", 4}, {"me", 4}, {"fr", 
  4}, {"fo", 4}, {"fa", 4}, {"do", 4}, {"ap", 4}, {"wo", 3}, {"ti", 
  3}, {"su", 3}, {"lo", 3}, {"le", 3}, {"la", 3}, {"is", 3}, {"in", 
  3}, {"gr", 3}, {"da", 3}, {"ch", 3}, {"bu", 3}, {"at", 3}, {"tr", 
  2}, {"ta", 2}, {"sc", 2}, {"re", 2}, {"qu", 2}, {"pr", 2}, {"po", 
  2}, {"pl", 2}, {"ne", 2}, {"kn", 2}, {"im", 2}, {"ey", 2}, {"di", 
  2}, {"de", 2}, {"by", 2}, {"br", 2}, {"bi", 2}, {"aw", 2}, {"am", 
  2}, {"al", 2}, {"ve", 1}, {"up", 1}, {"un", 1}, {"tu", 1}, {"te", 
  1}, {"sw", 1}, {"sm", 1}, {"sl", 1}, {"sh", 1}, {"ri", 1}, {"pi", 
  1}, {"ow", 1}, {"ot", 1}, {"op", 1}, {"ob", 1}, {"mu", 1}, {"ju", 
  1}, {"jo", 1}, {"il", 1}, {"if", 1}, {"ic", 1}, {"gu", 1}, {"ge", 
  1}, {"fi", 1}, {"fe", 1}, {"er", 1}, {"en", 1}, {"ea", 1}, {"dr", 
  1}, {"bo", 1}, {"av", 1}, {"as", 1}}
4 added 40 characters in body
source | link
mytext = "Now is the time for all good men to come to the aid of their party";

Flatten[
        Table[{i <> j, 
             Length[StringCases[mytext, 
             Shortest[WordBoundary ~~ i <> j ~~ __ ~~ WordBoundary]]]}, 
        {i, CharacterRange["a", "z"]}, 
        {j, CharacterRange["a", "z"]}], 
  1] // TableForm

Just replace mytext with your Hamlet text.

mytext = "Now is the time for all good men to come to the aid of their party";

Table[{i <> j, 
  Length[StringCases[mytext, 
    Shortest[WordBoundary ~~ i <> j ~~ __ ~~ WordBoundary]]]}, 
 {i, CharacterRange["a", "z"]}, {j, CharacterRange["a", "z"]}]

Just replace mytext with your Hamlet text.

mytext = "Now is the time for all good men to come to the aid of their party";

Flatten[
        Table[{i <> j, 
             Length[StringCases[mytext, 
             Shortest[WordBoundary ~~ i <> j ~~ __ ~~ WordBoundary]]]}, 
        {i, CharacterRange["a", "z"]}, 
        {j, CharacterRange["a", "z"]}], 
  1] // TableForm

Just replace mytext with your Hamlet text.

3 deleted 49 characters in body
source | link
xxxmytext = "Now is the time for all good men to come to the aid of their party";

Table[{ToString[i]i <> ToString[j]j, 
  Length[DictionaryLookup[iLength[StringCases[mytext, 
    Shortest[WordBoundary ~~ i <> j ~~ ___]]__ ~~ WordBoundary]]]}, 
 {i, 
  CharacterRange["a", "z"]}, {j, CharacterRange["a", "z"]}]
 
yyy = Flatten[xxx,1];

Reverse@SortBy[yyy, #[[2]] &]

{{"re", 3372}, {"co", 3244}, {"in", 2234}, {"un", 2162}, .....}

So "re" is the most frequent starting two letters, "co" the second, and so on Just replace mytext with your Hamlet text.

xxx = Table[{ToString[i] <> ToString[j], 
  Length[DictionaryLookup[i <> j ~~ ___]]}, {i, 
  CharacterRange["a", "z"]}, {j, CharacterRange["a", "z"]}]
 
yyy = Flatten[xxx,1];

Reverse@SortBy[yyy, #[[2]] &]

{{"re", 3372}, {"co", 3244}, {"in", 2234}, {"un", 2162}, .....}

So "re" is the most frequent starting two letters, "co" the second, and so on.

mytext = "Now is the time for all good men to come to the aid of their party";

Table[{i <> j, 
  Length[StringCases[mytext, 
    Shortest[WordBoundary ~~ i <> j ~~ __ ~~ WordBoundary]]]}, 
 {i, CharacterRange["a", "z"]}, {j, CharacterRange["a", "z"]}]

Just replace mytext with your Hamlet text.

2 added 139 characters in body
source | link
1
source | link