Skip to content

Commit

Permalink
added progress reports to ngraph
Browse files Browse the repository at this point in the history
  • Loading branch information
tmb committed Jul 14, 2009
1 parent 437a3cf commit 9b01ea3
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 1 deletion.
95 changes: 95 additions & 0 deletions ascii.voc
@@ -0,0 +1,95 @@
SPACE 32
! 33
" 34
35 35
$ 36
37 37
& 38
39 39
( 40
) 41
* 42
+ 43
, 44
- 45
. 46
/ 47
0 48
1 49
2 50
3 51
4 52
5 53
6 54
7 55
8 56
9 57
: 58
; 59
< 60
= 61
> 62
? 63
@ 64
A 65
B 66
C 67
D 68
E 69
F 70
G 71
H 72
I 73
J 74
K 75
L 76
M 77
N 78
O 79
P 80
Q 81
R 82
S 83
T 84
U 85
V 86
W 87
X 88
Y 89
Z 90
[ 91
\ 92
] 93
^ 94
_ 95
` 96
a 97
b 98
c 99
d 100
e 101
f 102
g 103
h 104
i 105
j 106
k 107
l 108
m 109
n 110
o 111
p 112
q 113
r 114
s 115
t 116
u 117
v 118
w 119
x 120
y 121
z 122
{ 123
| 124
} 125
~ 126
3 changes: 2 additions & 1 deletion pyfst-ngraph
@@ -1,6 +1,5 @@
#!/usr/bin/python2.5


import sys,os
from math import log
import openfst
Expand All @@ -13,6 +12,7 @@ n = int(sys.argv[2])
assert n>1 and n<30

for file in sys.argv[3:]:
sys.stderr.write("[%s]\n"%file)
for line in open(file).readlines():
line = "^"*(n-1) + line
for i in range(n,len(line)):
Expand All @@ -22,6 +22,7 @@ for file in sys.argv[3:]:
ngrams = counts.keys()
ngrams.sort()
total = sum(counts.values())
sys.stderr.write("[total %d-graphs = %d]\n"%(n,total))

fst = openfst.StdVectorFst()

Expand Down

0 comments on commit 9b01ea3

Please sign in to comment.