README.md in r_nlp-0.1.6 vs README.md in r_nlp-0.1.7
- old
+ new
@@ -20,10 +20,31 @@
$ gem install r_nlp
## Usage
-TODO: Write usage instructions here
+### Term Frequency(tf)
+
+```ruby
+a = RNlp::Tf.new('ja')
+text = '私は誰だ'
+
+p a.count(text)
+
+b = RNlp::Tf.new('en')
+text = 'who are you ?'
+
+p b.count(text)
+```
+
+### Inverse Document Frequency(idf)
+
+```ruby
+c = ['text 1 is hoge', 'text 2 is yeah', 'text 3 is hoge']
+
+idf = RNlp::Idf.new('en')
+p idf.calc_idf('hoge', c)
+```
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.