Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read/write from a file *object*? #10

Open
lebigot opened this issue Mar 24, 2013 · 2 comments
Open

read/write from a file *object*? #10

lebigot opened this issue Mar 24, 2013 · 2 comments

Comments

@lebigot
Copy link

lebigot commented Mar 24, 2013

Would it be possible to have fst.read()/write() read/write from/to a file object? this would be more flexible than reading through a file name only. An example application is to store and possibly compress the binary representation of a transducer completely in memory (for storage in the field of a database, etc.). With the current approach, all of this has to be done through disk read/writes, and this is not optimal.

If I understand correctly, this functionality is provided in the C++ source (http://www.openfst.org/doxygen/fst/html/classfst_1_1_fst.html#ad2c233e6e5047677dca3458f1b36c4f6).

@vchahun
Copy link
Owner

vchahun commented Apr 2, 2013

Unfortunately, I don't know of any way to obtain a iostream for a Python file object...

@lebigot
Copy link
Author

lebigot commented Apr 2, 2013

Thanks for considering this issue. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants