See LmReaders for documentation and the examples/ directory for some simple scripts.