The Python standard library already contains a
gettext module roughly compatible with the original GNU gettext library. Simply this module does not use the hash tables present in mo files to speedup accesses without loading the whole thing in memory.
I wondered if it would be easy to implement that hash table lookup and eventually be able to generate the table and dived into GNU gettext library sources. I soon thought that there would be no technical difficulties.
The hashing algorithm is not documented outside the source code, and the only way to write a compatible code even from scratch is to find in the code:
- the details of the hash function (it is a derivative of P.J Weinberger hash function)
- the lookup function which uses that hash function and a second function to deal with conflicts
- the method for determining the size of the hash table
The first 2 elements are in LGPL copyrighted source code, the last is in GPL copyrighted source code.
Everything else is documented and can be written from scratch with no need for copyrighted material.
I would like to use the Apache Free License 2.1 for my own work, which is of course a free license but incompatible with both GPL and LGPL. The goal would be to able to later contribute it to the Python Standard Library which uses its own PSF license and require an Apache license from its contributors.
Most of the code would of course be written from scratch, and what I would borrow from GPL or LGPL licensed code would be a very little yet essential part. Would it be acceptable or would it be a copyright infringement? Specifically would it still be a derivative work? And could all this be a fair use of the copyrighted material?