Skip to content

Commit 2284ef4

Browse files
committed
Make Jsgf iterable of JsgfRule.
Implement iterable behaviour in Jsgf to be able to iterate over its rules using compact notation of target languages. git-svn-id: svn+ssh://svn.code.sf.net/p/cmusphinx/code/trunk/sphinxbase@12386 94700074-3cef-4d97-a70e-9c8c206c02f5
1 parent 46d262a commit 2284ef4

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

swig/jsgf.i

+9
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,12 @@
8585
return jsgf_rule_public($self);
8686
}
8787
}
88+
89+
%runtime %{
90+
jsgf_rule_t * next_JsgfIterator(jsgf_rule_iter_t *iter)
91+
{
92+
return jsgf_rule_iter_rule(iter);
93+
}
94+
%}
95+
96+
/* vim: set ts=4 sw=4: */

swig/sphinxbase.i

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ typedef struct {} Config;
9393
typedef struct {} FrontEnd;
9494
typedef struct {} Feature;
9595
typedef struct {} FsgModel;
96-
typedef struct {} Jsgf;
9796
typedef struct {} JsgfRule;
9897
typedef struct {} NGramModel;
9998

10099
iterable(NGramModelSet, ngram_model_set, NGramModel)
100+
iterable(Jsgf, jsgf_rule, JsgfRule)
101101

102102
#ifdef HAS_DOC
103103
%include pydoc.i

0 commit comments

Comments
 (0)