social_tokenizer 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +34 -0
- data/VERSION +1 -1
- data/social_tokenizer.gemspec +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9c399d9552000d902fa8776e164e16678ee38f2
|
4
|
+
data.tar.gz: 8c38f6785416a1a0e172c4a1846b3c5cbeede0ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c500a4d6d993762f0bce8b080164ec2ceee04dc66a713595d2016fab32a5ef1ab0f1550be6111dd787bd62f70bee6cd5798fae1f544d0aae53e2af4dd61586c
|
7
|
+
data.tar.gz: 6fd33c7b1c4a7428e719509728cd7201e047c00c6b886a2f16531de8ce3cffe3b598b77422cfd0ebd0b50dd7ff274688443a84580ecfe40c7c715993418a09e2
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -5,6 +5,40 @@ Social Tokenizer
|
|
5
5
|
[![Build Status](https://travis-ci.org/gemvein/social_tokenizer.svg)](https://travis-ci.org/gemvein/social_tokenizer)
|
6
6
|
[![Coverage Status](https://coveralls.io/repos/gemvein/social_tokenizer/badge.png)](https://coveralls.io/r/gemvein/social_tokenizer)
|
7
7
|
|
8
|
+
Installation
|
9
|
+
------------
|
10
|
+
First, add the gem to your Gemfile
|
11
|
+
|
12
|
+
gem 'social_tokenizer'
|
13
|
+
|
14
|
+
Next, run the following commands
|
15
|
+
|
16
|
+
> bundle install
|
17
|
+
> rails g social_tokenizer:install
|
18
|
+
|
19
|
+
Usage
|
20
|
+
-----
|
21
|
+
|
22
|
+
When chained onto the end of a string:
|
23
|
+
|
24
|
+
string_to_tokenize = 'This string contains a @mention and a #tag.'
|
25
|
+
hash_of_tokens = string_to_tokenize.social_tokenize
|
26
|
+
|
27
|
+
By accessing the object directly:
|
28
|
+
|
29
|
+
lang = :de
|
30
|
+
social_tokenizer = SocialTokenizer::Tokenizer.new(lang)
|
31
|
+
hash_of_tokens = social_tokenizer.social_tokenize(self)
|
32
|
+
|
33
|
+
Special configuration
|
34
|
+
---------------------
|
35
|
+
|
36
|
+
Arbitrary token types can be defined in `initializers/social_tokenizer.rb` like this:
|
37
|
+
|
38
|
+
SocialTokenizer::TokenType.new(pattern: /^\+(.*)$/, replacement: '\1', key: :rate_up)
|
39
|
+
SocialTokenizer::TokenType.new(pattern: /^\-(.*)$/, replacement: '\1', key: :rate_down)
|
40
|
+
|
41
|
+
|
8
42
|
Contributing to Social Tokenizer
|
9
43
|
----------------------------
|
10
44
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
data/social_tokenizer.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: social_tokenizer 0.0.
|
5
|
+
# stub: social_tokenizer 0.0.4 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "social_tokenizer"
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.4"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|