Oald Parser¶ ↑
Description¶ ↑
OALD Parser (Oxford Advanced Learner’s Dictionary Parser) is a simple gem providing access to one of the best online dictionaries for people studing English.
Installation¶ ↑
gem install oald_parser
Usage¶ ↑
To hide the complexity of parsing and searching words I provide a simple facade:
facade = OaldParser::Facade.create_configured_instance
It can be used this way:
text = facade.describe(word: 'dog') OR text = facade.describe(str: 'a dog [CN]')
The ‘describe’ method returns plain text describing a word or a string.
Customizing¶ ↑
You can customize the behaviour of the facade by providing your own implemenation of one of the objects the facadeuses.
def self.create_configured_instance downloader = PageDownloader.new(URL) parser = PageParser.new formatter = Formatter.new extractor = WordExtractor.new Facade.new(downloader, parser, formatter, extractor) end
Please, take a look at a spec file for more details.