Do you know
-
Yes, it is Julia, here is the top 10:
1 Julia 85
2 meaning 36
3 Syme 34
4 society 30
5 top 30
6 cell 29
7 vocabulary 29
8 question 29
9 turn 28
10 speak 26It's quite interesting (or maybe my VBA is lousy).
The bearing of a child takes nine months, no matter how many women are assigned.
-
I know you gave me a bunch of hints but I'm still surprised it was in my top guesses. Now I'm curious how your VBS could be crappy. How do you define a word? Spaces on both side? Or can it be followed by Punctuation, ie " Julia. " and " Julia, " still count right?
"Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" — Hunter S. Thompson
I just used Document.Words[^] trimming the spaces. It appears that in VBA 'Word' is a broad concept, I got several combinations of punctuation marks.
The bearing of a child takes nine months, no matter how many women are assigned.
-
Actually I was just trying to see how long it takes to enumerate words in a document and got carried away.
The bearing of a child takes nine months, no matter how many women are assigned.
-
what is the most commonly used word in Orwell's Nineteen Eighty-Four?
The bearing of a child takes nine months, no matter how many women are assigned.
Um. According to a quick analysis, you are wrong:
5796 the
3463 of
2445 a
2309 was
2297 to
2293 and
1686 in
1443 that
1374 it
1338 had
1315 he
986 his
820 not
784 you
745 with
708 The
658 as
656 be
651 He
633 were
598 is
590 at
583 on
576 for
543 It
527 Winston"Julia" comes in at 100 times, the same as "away". And "the" is a proper word! ;P
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."
-
Um. According to a quick analysis, you are wrong:
5796 the
3463 of
2445 a
2309 was
2297 to
2293 and
1686 in
1443 that
1374 it
1338 had
1315 he
986 his
820 not
784 you
745 with
708 The
658 as
656 be
651 He
633 were
598 is
590 at
583 on
576 for
543 It
527 Winston"Julia" comes in at 100 times, the same as "away". And "the" is a proper word! ;P
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."
You're right. It turned out it was not the macro, I messed it up while importing to Excel and the text to columns feature swallowed several frequent words, including Winston. Maybe I should have used a different book for this. :doh:
The bearing of a child takes nine months, no matter how many women are assigned.
-
You're right. It turned out it was not the macro, I messed it up while importing to Excel and the text to columns feature swallowed several frequent words, including Winston. Maybe I should have used a different book for this. :doh:
The bearing of a child takes nine months, no matter how many women are assigned.
I did a PDF -> text, then knocked up a quick C# program:
string path = @"F:\\Temp\\1984.txt"; string\[\] lines = File.ReadAllLines(path); Regex pageIndicator = new Regex(@"\\s=\\sPage\\s\\d+\\s=", RegexOptions.Multiline | RegexOptions.CultureInvariant | RegexOptions.Compiled); Regex findWords = new Regex(@"\\b\\w+\\b", RegexOptions.Multiline | RegexOptions.CultureInvariant | RegexOptions.Compiled); Dictionary allWords = new Dictionary(); int totalWords = 0; foreach (string line in lines) { if (!pageIndicator.IsMatch(line)) { if (!string.IsNullOrEmpty(line)) { MatchCollection words = findWords.Matches(line); foreach (Match word in words) { totalWords++; if (allWords.ContainsKey(word.Value)) { allWords\[word.Value\]++; } else { allWords.Add(word.Value, 1); } } } } } labResults.Text = string.Format("Total: {0} words, with {1} distinct", totalWords, allWords.Count);
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."
-
I did a PDF -> text, then knocked up a quick C# program:
string path = @"F:\\Temp\\1984.txt"; string\[\] lines = File.ReadAllLines(path); Regex pageIndicator = new Regex(@"\\s=\\sPage\\s\\d+\\s=", RegexOptions.Multiline | RegexOptions.CultureInvariant | RegexOptions.Compiled); Regex findWords = new Regex(@"\\b\\w+\\b", RegexOptions.Multiline | RegexOptions.CultureInvariant | RegexOptions.Compiled); Dictionary allWords = new Dictionary(); int totalWords = 0; foreach (string line in lines) { if (!pageIndicator.IsMatch(line)) { if (!string.IsNullOrEmpty(line)) { MatchCollection words = findWords.Matches(line); foreach (Match word in words) { totalWords++; if (allWords.ContainsKey(word.Value)) { allWords\[word.Value\]++; } else { allWords.Add(word.Value, 1); } } } } } labResults.Text = string.Format("Total: {0} words, with {1} distinct", totalWords, allWords.Count);
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."
Must learn regex!
The bearing of a child takes nine months, no matter how many women are assigned.
-
Must learn regex!
The bearing of a child takes nine months, no matter how many women are assigned.
Worth it for something like this: I learnt it pretty much from playing with Expresso[^] - it explains, designs and tests regexes. It's free, and I wish I'd written it!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."
-
Probably, but I was only counting real words.
The bearing of a child takes nine months, no matter how many women are assigned.
"The" is a real word. Your experiment is flawed.
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
-
"The" is a real word. Your experiment is flawed.
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
Pete O'Hanlon wrote:
"The" is a real word.
Well, yes it is, but can it really compete with real, manly words like 'vocabulary' or 'society'?
The bearing of a child takes nine months, no matter how many women are assigned.