Class KizAPI::KeywordInContexts
In: lib/kizapi.rb
Parent: Array

KeyWordInContext is a class for fetching 3 sentences in context including a keyword.

Methods

new  

Classes and Modules

Class KizAPI::KeywordInContexts::Context

Attributes

date  [R] 
keyword  [R] 

Public Class methods

Fetch 3 sentences

[Source]

    # File lib/kizapi.rb, line 84
84:     def initialize(keyword)
85:       @keyword = keyword
86:       uri = URI.parse(URI.escape("http://kizasi.jp/kizapi.py?kw_expr=\#{keyword}&type=kwic\n".chomp))
87:       rss = RSS::Parser.parse(uri.read)
88:       @date = rss.channel.lastBuildDate
89:       super(rss.items.map{|item| Context.new(item)})
90:     end

[Validate]