Added basic ability to generate some documentation for digraphs. Needs work.

This commit is contained in:
Philip Monk 2013-09-29 17:04:22 -07:00
parent cb5ea44975
commit 600a500676
2 changed files with 188 additions and 0 deletions

81
doc/rune/runegen.py Executable file
View File

@ -0,0 +1,81 @@
#!/usr/bin/python
import re
names = {
"<" : "gal",
")" : "per",
"|" : "bar",
">" : "gar",
"[" : "sel",
"\\" : "bas",
"#" : "hax",
";" : "sem",
"$" : "buc",
"-" : "hep",
"]" : "ser",
"_" : "cab",
"{" : "kel",
"~" : "sig",
"%" : "cen",
"}" : "ker",
"'" : "soq",
":" : "col",
"^" : "ket",
"*" : "tar",
"," : "com",
"+" : "lus",
"`" : "tec",
"\"" : "doq",
"&" : "pam",
"=" : "tis",
"." : "dot",
"@" : "pat",
"?" : "wut",
"/" : "fas",
"(" : "pel",
"!" : "zap"}
runef = open("runelist.txt")
digraphs = []
phonemictexts = {}
symbols = {}
for line in runef:
if len(line) < 3:
continue
digraph = line.strip()
phonemictext = digraph
for graph,text in names.iteritems():
phonemictext = phonemictext.replace(graph,text)
digraphs.append(digraph)
phonemictexts[digraph] = phonemictext
phonemictexts[phonemictexts[digraph]] = digraph
symbols[digraph] = "%" + phonemictext[0] + phonemictext[2:4] + phonemictext[5]
symbols[symbols[digraph]] = digraph
#for i,j,k in zip(digraphs,phonemictexts,symbols):
# print i,k,j
hoonf = open("../../urb/zod/arvo/hoon.hoon")
genemode = False
genes = {}
for line in hoonf:
if not genemode:
if line[0:8] == "++ gene":
genemode = True
continue
if line[0:2] == "++":
genemode = False
continue
m = re.match(r'.*\[(%....) (.*)\].*',line)
if not m:
continue
if not m.group(1) in symbols:
continue
genes[symbols[m.group(1)]] = m.group(0)
genes[genes[symbols[m.group(1)]]] = m.group(1)
for i in digraphs:
print i, symbols[i], phonemictexts[i]
if i in genes:
print genes[i]

107
doc/rune/runelist.txt Normal file
View File

@ -0,0 +1,107 @@
||
|_
|%
|:
|.
|-
|^
|+
|*
|=
|?
%_
%:
%.
%^
%+
%-
%~
%*
%=
$|
$_
$:
$%
$,
$&
$?
:_
:~
:/
:^
:+
:-
:~
:*
.+
.*
.=
.?
.^
#<
#>
^|
^.
^-
^+
^&
^~
^=
^?
~|
~$
~%
~:
~/
~<
~>
~#
~^
~+
~&
~=
~!
;_
;,
;%
;:
;.
;<
;>
;-
;+
;&
;~
;;
;*
;=
;?
=|
=.
=^
=:
=<
=>
=-
=+
=~
?|
?:
?.
?<
?>
?-
?^
?=
?+
?&
?@
?~
?!
!:
!,
!;
!^
!>
!=