chokkan/crfsuite — pull request #9 by smhanov (2013-02-06 17:47:59+00:00)
Title: Allows opening a model from memory instead of a file

For my application, I wish to keep the model inside of a file along with other data related to the problem. For this purpose, I have implemented crfsuite_create_instance_from_ptr() which takes a pointer to memory and its length to create the instance. That way, the CRF model does not need to be stored in its own file.

I have handled the 16-byte alignment requirement by copying the data only if it is not correctly aligned.

I have updated the C++ API and tested that it works in my own software. If you want, you may incorporate this into CRFSuite.