eps2disambig.pl 821 B

1234567891011121314151617181920212223
  1. #!/usr/bin/perl
  2. # Copyright 2010-2011 Microsoft Corporation
  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. # THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  10. # KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  11. # WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  12. # MERCHANTABLITY OR NON-INFRINGEMENT.
  13. # See the Apache 2 License for the specific language governing permissions and
  14. # limitations under the License.
  15. # This script replaces epsilon with #0 on the input side only, of the G.fst
  16. # acceptor.
  17. while(<>){
  18. s:^(\d+\s+\d+\s+)\<eps\>(\s+):$1#0$2:;
  19. print;
  20. }