• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // text-io.h
2 
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 // Copyright 2005-2010 Google, Inc.
16 // Author: riley@google.com (Michael Riley)
17 // Modified: jpr@google.com (Jake Ratkiewicz) to work with generic WeightClass
18 //
19 // \file
20 // Utilities for reading and writing textual strings representing
21 // states, labels, and weights and files specifying label-label pairs
22 // and potentials (state-weight pairs).
23 //
24 
25 #ifndef FST_SCRIPT_TEXT_IO_H__
26 #define FST_SCRIPT_TEXT_IO_H__
27 
28 #include <string>
29 #include <vector>
30 using std::vector;
31 
32 
33 #include <iostream>
34 #include <fstream>
35 #include <sstream>
36 #include <fst/script/weight-class.h>
37 
38 namespace fst {
39 namespace script {
40 
41 bool ReadPotentials(const string &weight_type,
42                     const string& filename,
43                     vector<WeightClass>* potential);
44 
45 bool WritePotentials(const string& filename,
46                      const vector<WeightClass>& potential);
47 
48 }  // namespace script
49 }  // namespace fst
50 
51 #endif  // FST_SCRIPT_TEXT_IO_H__
52