Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
223 views
in Technique[技术] by (71.8m points)

OpenFST unique ShortestPath with epsilon

Given an FST and alphabet which includes a blank char (''), I want to find the N unique shortest paths:

  • Unique in the sense that there are no two paths with equal labels concatenation - e.g., ['a', '', 'b'] and ['a', 'b', ''] are considered equal.
  • The output should be a list of labels including blank chars. All the paths from start node to end node in the input FST are of the same length, and the shortest path output should maintain this property.

OpenFST's ShortestPath takes an unique argument. However, as the documentation suggests "epsilons treated as regular symbols", therefore I cannot define '' as epsilon and use ShortestPath on the FST directly.

One idea I had, is to define '' as the epsilon symbol, remove all the epsilon symbols (using RmEpsilon), find the N unique shortest paths, and try to search each of the shortest paths in the original FST to re-construct paths with '' symbols. However, I am not sure how I can do the last part.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...