<!DOCTYPE html>
<html lang="en" dir="ltr" class="client-nojs">
<head>
<meta charset="UTF-8" />
<title>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" />
<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="load.php?debug=false&amp;lang=en&amp;modules=mediawiki.legacy.commonPrint,shared|mediawiki.skinning.interface|mediawiki.ui.button|skins.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":26129,"wgArticleId":5883,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":[],"wgBreakFrames":false,"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.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-view">
<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">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="./Talk:Word_list_from_the_manuals#column-one">navigation</a>, <a href="./Talk:Word_list_from_the_manuals#searchInput">search</a></div>

		<!-- start content -->
<div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><pre>
#!/usr/bin/env python3

import sys
import re
import pathlib

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

def main():
    get_words('Restoration of Erathia', 'RoE', 144)
    get_words(&quot;Armageddon's Blade&quot;, '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&quot;[[Category:{name} Manual|*]]&quot;, '')
    for word in re.split(f&quot;\s+|/|\\\\|\|&quot;, 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 &gt; 2 and (word[length - 2&#160;:] == &quot;'s&quot; or word[length - 2&#160;:] == '(s'):
        add_word(word[0&#160;: 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=&quot;wikitable sortable&quot; style=&quot;white-space:nowrap; text-align: center;&quot;\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=&quot;vertical-align: center; text-align: left;&quot; | {word}\n')
        word_list.write(f'| style=&quot;vertical-align: center; text-align: center;&quot; | {words[word]}\n')
    word_list.write('|}')

if __name__ == &quot;__main__&quot;:
    main()

# Project Structure
# /projects/manuals/AB/_AB.txt
# /projects/manuals/RoE/_RoE.txt
# /projects/manuals/SoD/_SoD.txt
# /projects/manuals/Tutorial/_Tutorial.txt
</pre>

<!-- 
NewPP limit report
CPU time usage: 0.008 seconds
Real time usage: 0.006 seconds
Preprocessor visited node count: 4/1000000
Preprocessor generated node count: 24/1000000
Post‐expand include size: 0/2097152 bytes
Template argument size: 0/2097152 bytes
Highest expansion depth: 2/40
Expensive parser function count: 0/100
-->

<!-- Saved in parser cache with key h3wiki:pcache:idhash:5883-0!*!*!*!*!*!* and timestamp 20190807212530 and revision id 26129
 -->
</div><div class="printfooter">
Retrieved from "<a href="./index.php?title=Talk:Word_list_from_the_manuals&amp;oldid=26129">http://heroes.thelazy.net/wiki/index.php?title=Talk:Word_list_from_the_manuals&amp;oldid=26129</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="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 [e]" accesskey="e">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="./index.php?title=Special:UserLogin&amp;returnto=Talk:Word+list+from+the+manuals&amp;returntoquery=t=Talk%253AWord_list_from_the_manuals&amp;type=signup">Create account</a></li>
				<li id="pt-login"><a href="./index.php?title=Special:UserLogin&amp;returnto=Talk:Word+list+from+the+manuals&amp;returntoquery=t=Talk%253AWord_list_from_the_manuals" 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-print"><a href="./index.php?title=Talk:Word_list_from_the_manuals&amp;t=Talk:Word_list_from_the_manuals&amp;printable=yes" rel="alternate" title="Printable version of this page [p]" accesskey="p">Printable version</a></li>
				<li id="t-permalink"><a href="./index.php?title=Talk:Word_list_from_the_manuals&amp;oldid=26129" title="Permanent link to this revision of the page">Permanent link</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="lastmod"> This page was last modified on 8 January 2017, at 00:02.</li>
		<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.view.postEdit","mediawiki.user","mediawiki.hidpi","mediawiki.page.ready","mediawiki.searchSuggest"],null,true);
}</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":110});
}</script></body></html>