Class: Okura::Serializer::UnkDic::Marshal
- Inherits:
-
Object
- Object
- Okura::Serializer::UnkDic::Marshal
- Defined in:
- lib/okura/serializer.rb
Instance Method Summary collapse
Instance Method Details
#compile(char_types, features_l, features_r, input, output) ⇒ Object
266 267 268 269 270 271 272 273 |
# File 'lib/okura/serializer.rb', line 266 def compile(char_types,features_l,features_r,input,output) unk=Okura::UnkDic.new char_types parser=Okura::Parser::UnkDic.new input parser.each{|type_name,lid,rid,cost| unk.define type_name,features_l.from_id(lid),features_r.from_id(rid),cost } ::Marshal.dump(unk,output) end |
#load(io) ⇒ Object
274 275 276 |
# File 'lib/okura/serializer.rb', line 274 def load(io) ::Marshal.load(io) end |