• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 // Licensed under the Apache License, Version 2.0 (the "License");
3 // you may not use this file except in compliance with the License.
4 // You may obtain a copy of the License at
5 //
6 //     http://www.apache.org/licenses/LICENSE-2.0
7 //
8 // Unless required by applicable law or agreed to in writing, software
9 // distributed under the License is distributed on an "AS IS" BASIS,
10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 // See the License for the specific language governing permissions and
12 // limitations under the License.
13 //
14 // Copyright 2005-2010 Google, Inc.
15 // Author: jpr@google.com (Jake Ratkiewicz)
16 
17 #include <string>
18 
19 #include <fst/script/fst-class.h>
20 #include <fst/script/draw.h>
21 #include <fst/script/script-impl.h>
22 
23 namespace fst {
24 namespace script {
25 
DrawFst(const FstClass & fst,const SymbolTable * isyms,const SymbolTable * osyms,const SymbolTable * ssyms,bool accep,const string & title,float width,float height,bool portrait,bool vertical,float ranksep,float nodesep,int fontsize,int precision,bool show_weight_one,ostream * ostrm,const string & dest)26 void DrawFst(const FstClass &fst,
27              const SymbolTable *isyms,
28              const SymbolTable *osyms,
29              const SymbolTable *ssyms,
30              bool accep,
31              const string &title,
32              float width,
33              float height,
34              bool portrait,
35              bool vertical,
36              float ranksep,
37              float nodesep,
38              int fontsize,
39              int precision,
40              bool show_weight_one,
41              ostream *ostrm,
42              const string &dest) {
43   FstDrawerArgs args(fst, isyms, osyms, ssyms, accep, title, width,
44                      height, portrait, vertical, ranksep, nodesep,
45                      fontsize, precision, show_weight_one, ostrm, dest);
46 
47   Apply<Operation<FstDrawerArgs> >("DrawFst", fst.ArcType(), &args);
48 }
49 
50 REGISTER_FST_OPERATION(DrawFst, StdArc, FstDrawerArgs);
51 REGISTER_FST_OPERATION(DrawFst, LogArc, FstDrawerArgs);
52 REGISTER_FST_OPERATION(DrawFst, Log64Arc, FstDrawerArgs);
53 
54 }  // namespace script
55 }  // namespace fst
56