<!DOCTYPE html>
<html lang="en" dir="ltr" class="client-nojs">
<head>
<meta charset="UTF-8" />
<title>Editing Talk:Word list from the manuals - The Heroes of Might and Magic III wiki</title>
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta name="generator" content="MediaWiki 1.23.5" />
<meta name="robots" content="noindex,nofollow" />
<link rel="alternate" type="application/x-wiki" title="Edit" href="./index.php?title=Talk:Word_list_from_the_manuals&amp;action=edit" />
<link rel="edit" title="Edit" href="./index.php?title=Talk:Word_list_from_the_manuals&amp;action=edit" />
<link rel="shortcut icon" href="favicon.ico" />
<link rel="search" type="application/opensearchdescription+xml" href="opensearch_desc.php" title="The Heroes of Might and Magic III wiki (en)" />
<link rel="EditURI" type="application/rsd+xml" href="api.php?action=rsd" />
<link rel="alternate" type="application/atom+xml" title="The Heroes of Might and Magic III wiki Atom feed" href="./index.php?title=Special:RecentChanges&amp;feed=atom" />
<link rel="stylesheet" href="http://heroes.thelazy.net/wiki/load.php?debug=false&amp;lang=en&amp;modules=mediawiki.action.edit.styles%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.skinning.interface%7Cmediawiki.ui.button%7Cskins.monobook.styles&amp;only=styles&amp;skin=monobook&amp;*" />
<!--[if IE 6]><link rel="stylesheet" href="/wiki/skins/monobook/IE60Fixes.css?303" media="screen" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" href="/wiki/skins/monobook/IE70Fixes.css?303" media="screen" /><![endif]--><meta name="ResourceLoaderDynamicStyles" content="" />
<link rel="stylesheet" href="load.php?debug=false&amp;lang=en&amp;modules=site&amp;only=styles&amp;skin=monobook&amp;*" />
<style>a:lang(ar),a:lang(kk-arab),a:lang(mzn),a:lang(ps),a:lang(ur){text-decoration:none}
/* cache key: h3wiki:resourceloader:filter:minify-css:7:9987a8d12e227de4fc8ea4a562cec67b */</style>
<script src="load.php?debug=false&amp;lang=en&amp;modules=startup&amp;only=scripts&amp;skin=monobook&amp;*"></script>
<script>if(window.mw){
mw.config.set({"wgCanonicalNamespace":"Talk","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":1,"wgPageName":"Talk:Word_list_from_the_manuals","wgTitle":"Word list from the manuals","wgCurRevisionId":26129,"wgRevisionId":0,"wgArticleId":5883,"wgIsArticle":false,"wgIsRedirect":false,"wgAction":"edit","wgUserName":null,"wgUserGroups":["*"],"wgCategories":[],"wgBreakFrames":true,"wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgMonthNamesShort":["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"wgRelevantPageName":"Talk:Word_list_from_the_manuals","wgIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[]});
}</script><script>if(window.mw){
mw.loader.implement("user.options",function($,jQuery){mw.user.options.set({"ccmeonemails":0,"cols":80,"date":"default","diffonly":0,"disablemail":0,"editfont":"default","editondblclick":0,"editsectiononrightclick":0,"enotifminoredits":0,"enotifrevealaddr":0,"enotifusertalkpages":1,"enotifwatchlistpages":1,"extendwatchlist":0,"fancysig":0,"forceeditsummary":0,"gender":"unknown","hideminor":0,"hidepatrolled":0,"imagesize":2,"math":1,"minordefault":0,"newpageshidepatrolled":0,"nickname":"","norollbackdiff":0,"numberheadings":0,"previewonfirst":0,"previewontop":1,"rcdays":7,"rclimit":50,"rows":25,"showhiddencats":0,"shownumberswatching":1,"showtoolbar":1,"skin":"monobook","stubthreshold":0,"thumbsize":2,"underline":2,"uselivepreview":0,"usenewrc":0,"watchcreations":1,"watchdefault":1,"watchdeletion":0,"watchlistdays":3,"watchlisthideanons":0,"watchlisthidebots":0,"watchlisthideliu":0,"watchlisthideminor":0,"watchlisthideown":0,"watchlisthidepatrolled":0,"watchmoves":0,"wllimit":250,
"useeditwarning":1,"prefershttps":1,"language":"en","variant-gan":"gan","variant-iu":"iu","variant-kk":"kk","variant-ku":"ku","variant-shi":"shi","variant-sr":"sr","variant-tg":"tg","variant-uz":"uz","variant-zh":"zh","searchNs0":true,"searchNs1":false,"searchNs2":false,"searchNs3":false,"searchNs4":false,"searchNs5":false,"searchNs6":false,"searchNs7":false,"searchNs8":false,"searchNs9":false,"searchNs10":false,"searchNs11":false,"searchNs12":false,"searchNs13":false,"searchNs14":false,"searchNs15":false,"variant":"en"});},{},{});mw.loader.implement("user.tokens",function($,jQuery){mw.user.tokens.set({"editToken":"+\\","patrolToken":false,"watchToken":false});},{},{});
/* cache key: h3wiki:resourceloader:filter:minify-js:7:9f426b327d5b26fdba4b6c7f571e2def */
}</script>
<script>if(window.mw){
mw.loader.load(["mediawiki.action.edit","mediawiki.page.startup","mediawiki.legacy.wikibits","mediawiki.legacy.ajax"]);
}</script>
</head>
<body class="mediawiki ltr sitedir-ltr ns-1 ns-talk page-Talk_Word_list_from_the_manuals skin-monobook action-edit">
<div id="globalWrapper">
<div id="column-content">

<div id="content" class="mw-body-primary" role="main" style="padding-right: 124px;">

<div id="addie" style="position: absolute; right: 0;">

<script type="text/javascript"><!--
google_ad_client = "ca-pub-6690847397983079";
/* SideBarH3Wiki */
google_ad_slot = "8403653991";
google_ad_width = 120;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


	<a id="top"></a>
	
	<h1 id="firstHeading" class="firstHeading" lang="en"><span dir="auto">Editing Talk:Word list from the manuals</span></h1>
	<div id="bodyContent" class="mw-body">
		<div id="siteSub">From The Heroes of Might and Magic III wiki</div>
		<div id="contentSub"></div>
		<div id="jump-to-nav" class="mw-jump">Jump to: <a href="./index.php?title=Talk:Word_list_from_the_manuals&amp;action=edit#column-one">navigation</a>, <a href="./index.php?title=Talk:Word_list_from_the_manuals&amp;action=edit#searchInput">search</a></div>

		<!-- start content -->
<div id="mw-content-text"><div id="mw-anon-edit-warning">
<p><strong>Warning:</strong> You are not logged in.
</p>
Your IP address will be recorded in this page's edit history.</div>
<div id="wikiPreview" class="ontop" style="display: none;"></div><form id="editform" name="editform" method="post" action="http://heroes.thelazy.net/wiki/index.php?title=Talk:Word_list_from_the_manuals&amp;action=submit" enctype="multipart/form-data"><div id="antispam-container" style="display: none;"><label for="wpAntiSpam">Anti-spam check.
Do <strong>NOT</strong> fill this in!</label><input type="text" name="wpAntispam" id="wpAntispam" value="" /></div><input type='hidden' value="" name="wpSection" />
<input type='hidden' value="20190808100203" name="wpStarttime" />
<input type='hidden' value="20170107220228" name="wpEdittime" />
<input type='hidden' value="" name="wpScrolltop" id="wpScrolltop" />
<input type="hidden" value="d41d8cd98f00b204e9800998ecf8427e" name="wpAutoSummary" /><input type="hidden" value="0" name="oldid" /><input type="hidden" value="text/x-wiki" name="format" /><input type="hidden" value="wikitext" name="model" /><div id="toolbar"></div><textarea tabindex="1" accesskey="," id="wpTextbox1" cols="80" rows="25" style="" lang="en" dir="ltr" name="wpTextbox1">&lt;pre>
#!/usr/bin/env python3

import sys
import re
import pathlib

path_to_files = '/projects/manuals'
words = dict()
before_or_after = '\',.(){}[]?!"*+-:&lt;>;'

def main():
    get_words('Restoration of Erathia', 'RoE', 144)
    get_words("Armageddon's Blade", 'AB', 28)
    get_words('Shadow of Death', 'SoD', 36)
    get_words('Tutorial', 'Tutorial', 12)
    print_words()

def get_words(name, short_name, total_pages):
    folder = f'{path_to_files}/{short_name}'
    path = pathlib.PurePath(f'{folder}/_{short_name}.txt')
    file = open(path, encoding='utf-8')
    text = file.read().replace(f"[[Category:{name} Manual|*]]", '')
    for word in re.split(f"\s+|/|\\\\|\|", text):
        add_word(word)

def add_word(word):
    global words
    global before_and_after
    global before_or_after
    length = len(word)
    if word == '':
        return
    elif length > 2 and (word[length - 2 :] == "'s" or word[length - 2 :] == '(s'):
        add_word(word[0 : length - 2])
    elif word[0] in before_or_after or word[-1] in before_or_after:
        add_word(word.strip(before_or_after))
    elif word in words:
        words[word] = words[word] + 1
    else:
        words[word] = 1

def print_words():
    global words
    word_list = open('word_list.txt', 'w', encoding='utf-8')
    word_list.write('{| class="wikitable sortable" style="white-space:nowrap; text-align: center;"\n')
    word_list.write('! Word\n! Count\n')
    for word in sorted(words.keys(), key=lambda word: word.lower()):
        word_list.write(f'|-\n| style="vertical-align: center; text-align: left;" | {word}\n')
        word_list.write(f'| style="vertical-align: center; text-align: center;" | {words[word]}\n')
    word_list.write('|}')

if __name__ == "__main__":
    main()

# Project Structure
# /projects/manuals/AB/_AB.txt
# /projects/manuals/RoE/_RoE.txt
# /projects/manuals/SoD/_SoD.txt
# /projects/manuals/Tutorial/_Tutorial.txt
&lt;/pre>
</textarea><div class='editOptions'>
<span class="mw-summary" id="wpSummaryLabel"><label for="wpSummary">Summary:</label></span> <input class="mw-summary" id="wpSummary" maxlength="200" tabindex="1" size="60" spellcheck="true" title="Enter a short summary [b]" accesskey="b" name="wpSummary" /><div class='editCheckboxes'>
</div>
<div id="editpage-copywarn">
<p>Please note that all contributions to The Heroes of Might and Magic III wiki may be edited, altered, or removed by other contributors.
If you do not want your writing to be edited mercilessly, then do not submit it here.<br />
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see <a href="http://heroes.thelazy.net/wiki/The_Heroes_of_Might_and_Magic_III_wiki:Copyrights" title="The Heroes of Might and Magic III wiki:Copyrights">The Heroes of Might and Magic III wiki:Copyrights</a> for details).
<strong>Do not submit copyrighted work without permission!</strong>
</p>
</div>
<div class='editButtons'>
<input id="wpSave" name="wpSave" type="submit" tabindex="3" value="Save page" accesskey="s" title="Save your changes [s]" />
<input id="wpPreview" name="wpPreview" type="submit" tabindex="4" value="Show preview" accesskey="p" title="Preview your changes, please use this before saving! [p]" />

<input id="wpDiff" name="wpDiff" type="submit" tabindex="5" value="Show changes" accesskey="v" title="Show which changes you made to the text [v]" />
	<span class='cancelLink'><a href="./Talk:Word_list_from_the_manuals" title="Talk:Word list from the manuals" id="mw-editform-cancel">Cancel</a><span class="mw-editButtons-pipe-separator"> | </span></span>
	<span class='editHelp'><a target="helpwindow" href="https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Editing_pages">Editing help</a> (opens in new window)</span>
</div><!-- editButtons -->
</div><!-- editOptions -->

<input type="hidden" value="+\" name="wpEditToken" />
<div class="mw-editTools"></div>
<div class="templatesUsed"></div><div class="hiddencats"></div><div class="limitreport"></div>
</form>
</div><div class="printfooter">
Retrieved from "<a href="./Talk:Word_list_from_the_manuals">http://heroes.thelazy.net/wiki/Talk:Word_list_from_the_manuals</a>"</div>
		<div id='catlinks' class='catlinks catlinks-allhidden'></div>		<!-- end content -->
				<div class="visualClear"></div>
	</div>
</div></div>
<div id="column-one">
	<h2>Navigation menu</h2>
	<div id="p-cactions" class="portlet" role="navigation">
		<h3>Views</h3>
		<div class="pBody">
			<ul>
				<li id="ca-nstab-main"><a href="Word_list_from_the_manuals" title="View the content page [c]" accesskey="c">Page</a></li>
				<li id="ca-talk" class="selected"><a href="./Talk:Word_list_from_the_manuals" title="Discussion about the content page [t]" accesskey="t">Discussion</a></li>
				<li id="ca-edit" class="selected istalk"><a href="./index.php?title=Talk:Word_list_from_the_manuals&amp;action=edit" title="You can edit this page. Please use the preview button before saving">Edit</a></li>
				<li id="ca-addsection"><a href="./index.php?title=Talk:Word_list_from_the_manuals&amp;action=edit&amp;section=new" title="Start a new section [+]" accesskey="+">+</a></li>
				<li id="ca-history"><a href="./index.php?title=Talk:Word_list_from_the_manuals&amp;action=history" rel="archives" title="Past revisions of this page [h]" accesskey="h">History</a></li>
			</ul>
		</div>
	</div>
	<div class="portlet" id="p-personal" role="navigation">
		<h3>Personal tools</h3>
		<div class="pBody">
			<ul>
				<li id="pt-createaccount"><a href="http://heroes.thelazy.net/wiki/index.php?title=Special:UserLogin&amp;returnto=Talk%3AWord+list+from+the+manuals&amp;returntoquery=action%3Dedit&amp;type=signup">Create account</a></li>
				<li id="pt-login"><a href="http://heroes.thelazy.net/wiki/index.php?title=Special:UserLogin&amp;returnto=Talk%3AWord+list+from+the+manuals&amp;returntoquery=action%3Dedit" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o">Log in</a></li>
			</ul>
		</div>
	</div>
	<div class="portlet" id="p-logo" role="banner">
<a href="Main_Page" style="background-image: url(h3logo.png);" title="Visit the main page"></a>
	</div>
	<div class="generated-sidebar portlet" id="p-navigation" role="navigation">
		<h3>Navigation</h3>
		<div class='pBody'>
			<ul>
				<li id="n-mainpage-description"><a href="Main_Page" title="Visit the main page [z]" accesskey="z">Main page</a></li>
				<li id="n-recentchanges"><a href="./Special:RecentChanges" title="A list of recent changes in the wiki [r]" accesskey="r">Recent changes</a></li>
				<li id="n-randompage"><a href="./Special:Random" title="Load a random page [x]" accesskey="x">Random page</a></li>
				<li id="n-help"><a href="https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents" title="The place to find out">Help</a></li>
			</ul>
		</div>
	</div>
	<div id="p-search" class="portlet" role="search">
		<h3><label for="searchInput">Search</label></h3>
		<div id="searchBody" class="pBody">
			<form action="http://heroes.thelazy.net/wiki/index.php" id="searchform">
				<input type='hidden' name="title" value="Special:Search"/>
				<input type="search" name="search" placeholder="Search" title="Search The Heroes of Might and Magic III wiki [f]" accesskey="f" id="searchInput" />
				<input type="submit" name="go" value="Go" title="Go to a page with this exact name if exists" id="searchGoButton" class="searchButton" />&#160;
				<input type="submit" name="fulltext" value="Search" title="Search the pages for this text" id="mw-searchButton" class="searchButton" />
			</form>

					</div>
	</div>
	<div class="portlet" id="p-tb" role="navigation">
		<h3>Tools</h3>
		<div class="pBody">
			<ul>
				<li id="t-whatlinkshere"><a href="./Talk:Word_list_from_the_manuals.1" title="A list of all wiki pages that link here [j]" accesskey="j">What links here</a></li>
				<li id="t-recentchangeslinked"><a href="./Talk:Word_list_from_the_manuals.2" title="Recent changes in pages linked from this page [k]" accesskey="k">Related changes</a></li>
				<li id="t-specialpages"><a href="./Special:SpecialPages" title="A list of all special pages [q]" accesskey="q">Special pages</a></li>
				<li id="t-info"><a href="./index.php?title=Talk:Word_list_from_the_manuals&amp;action=info">Page information</a></li>
			</ul>
		</div>
	</div>
</div><!-- end of the left (by default at least) column -->
<div class="visualClear"></div>
<div id="footer" role="contentinfo">
	<div id="f-poweredbyico">
		<a href="http://www.mediawiki.org/"><img src="poweredby_mediawiki_88x31.png" alt="Powered by MediaWiki" width="88" height="31" /></a>
	</div>
	<ul id="f-list">
		<li id="privacy"><a href="./The_Heroes_of_Might_and_Magic_III_wiki:Privacy_policy" title="The Heroes of Might and Magic III wiki:Privacy policy">Privacy policy</a></li>
		<li id="about"><a href="./The_Heroes_of_Might_and_Magic_III_wiki:About" title="The Heroes of Might and Magic III wiki:About">About The Heroes of Might and Magic III wiki</a></li>
		<li id="disclaimer"><a href="./The_Heroes_of_Might_and_Magic_III_wiki:General_disclaimer" title="The Heroes of Might and Magic III wiki:General disclaimer">Disclaimers</a></li>
	</ul>
</div>
</div>

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-7375938-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>


<script>/*<![CDATA[*/window.jQuery && jQuery.ready();/*]]>*/</script><script>if(window.mw){
mw.loader.state({"site":"loading","user":"ready","user.groups":"ready"});
}</script>
<script>if(window.mw){
mw.loader.load(["mediawiki.action.edit.editWarning","mediawiki.action.edit.collapsibleFooter","mediawiki.user","mediawiki.hidpi","mediawiki.page.ready","mediawiki.searchSuggest"],null,true);
}</script>
<script>if(window.mw){
mw.loader.using("mediawiki.action.edit", function() {mw.toolbar.addButton("/wiki/skins/common/images/button_bold.png","Bold text","'''","'''","Bold text","mw-editbutton-bold");mw.toolbar.addButton("/wiki/skins/common/images/button_italic.png","Italic text","''","''","Italic text","mw-editbutton-italic");mw.toolbar.addButton("/wiki/skins/common/images/button_link.png","Internal link","[[","]]","Link title","mw-editbutton-link");mw.toolbar.addButton("/wiki/skins/common/images/button_extlink.png","External link (remember http:// prefix)","[","]","http://www.example.com link title","mw-editbutton-extlink");mw.toolbar.addButton("/wiki/skins/common/images/button_headline.png","Level 2 headline","\n== "," ==\n","Headline text","mw-editbutton-headline");mw.toolbar.addButton("/wiki/skins/common/images/button_image.png","Embedded file","[[File:","]]","Example.jpg","mw-editbutton-image");mw.toolbar.addButton("/wiki/skins/common/images/button_media.png","File link","[[Media:","]]","Example.ogg","mw-editbutton-media");mw.toolbar.addButton("/wiki/skins/common/images/button_nowiki.png","Ignore wiki formatting","\u003Cnowiki\u003E","\u003C/nowiki\u003E","Insert non-formatted text here","mw-editbutton-nowiki");mw.toolbar.addButton("/wiki/skins/common/images/button_sig.png","Your signature with timestamp","--~~~~","","","mw-editbutton-signature");mw.toolbar.addButton("/wiki/skins/common/images/button_hr.png","Horizontal line (use sparingly)","\n----\n","","","mw-editbutton-hr");
// Create button bar
$(function() { mw.toolbar.init(); } );
});
}</script>
<script src="load.php?debug=false&amp;lang=en&amp;modules=site&amp;only=scripts&amp;skin=monobook&amp;*"></script>
<script>if(window.mw){
mw.config.set({"wgBackendResponseTime":211});
}</script></body></html>