This implements the standard phrase-based and hierarchical phrase-based rule extraction algorithms. But there is a twist -- this script also works with phrases as atomic unit (instead of words). Not pretty, but works. To run, uncomment the call to main() and run: ./phrase2_extraction.rb example.txt