typogen 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c2128561f9eb18925e68bdf2e0b693097d0fa0f
4
- data.tar.gz: d48ea148f4c51b74e1691d10f90c3727e72a90ab
3
+ metadata.gz: a217b95ca870342522b67248d3a59b64df3ea55b
4
+ data.tar.gz: f0277271de18ea89173b2f80e9f5f7c5d55dca02
5
5
  SHA512:
6
- metadata.gz: 39f0017e6c5467cae634b024a82303e23ea71b20165030e18d230213021228209dca7b47ccc4b0f38ccc4482ff891b74bd8c328b955377c103a8e46cc7da9a10
7
- data.tar.gz: 25b41bb8e312ce6358277908d0b425be9b38dd2956f5dce3b3584f87a4eef94256b186114be53e7dfc390a4216c673872d2f3741066aeee3c30ef4a411eecacb
6
+ metadata.gz: 1a82a7dc957e30a9fe6e314ab1d679fc8bc42d1b653141718198339125be0ab37fd4da6898ae43a86d760697b62ec5a1b76ac9459dade8dc37002b89be74bfdf
7
+ data.tar.gz: d0f27625bf7c87d297888278a37fe1fbb1bfe5a778fc7464451c09997541a7c70154d98cef80e8b6d9da4a0d99230df2db8f2106e4270b5e6b1bcae11d954e26
@@ -1,6 +1,8 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
+ - 2.0
5
+ - 2.1
4
6
  - 2.2
5
7
  - 2.3.3
6
8
  before_install: gem install bundler -v 1.14.3
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # TypoGen
2
2
 
3
+ [![Build Status](https://travis-ci.org/siman-man/typogen.svg?branch=master)](https://travis-ci.org/siman-man/typogen)
4
+
3
5
  Simple typo generator (English)
4
6
 
5
7
  ## Installation
6
8
 
7
- Or install it yourself as:
8
-
9
9
  ```
10
10
  $ gem install typogen
11
11
  ```
@@ -19,7 +19,7 @@ $ typogen [word]
19
19
  ## Example
20
20
 
21
21
  ```
22
- typogen install
22
+ $ typogen install
23
23
  ```
24
24
 
25
25
  output
@@ -1,6 +1,7 @@
1
1
  require 'typogen/version'
2
2
  require 'typogen/skip_letter'
3
3
  require 'typogen/swap_letter'
4
+ require 'typogen/start_same_sound'
4
5
  require 'typogen/end_same_sound'
5
6
  require 'typogen/typo'
6
7
  require 'typogen/cli'
@@ -8,8 +8,8 @@ module TypoGen
8
8
  %w(ser cer),
9
9
  %w(val vel),
10
10
  %w(rize lize),
11
- %w(ry ly)
12
- ]
11
+ %w(ry ly),
12
+ ].freeze
13
13
 
14
14
  def self.create(word)
15
15
  typo_list = []
@@ -0,0 +1,27 @@
1
+ module TypoGen
2
+ class StartSameSound
3
+ PATTERN_LIST = [
4
+ %w(in im),
5
+ %w(con com),
6
+ %w(clo cro),
7
+ %w(cou coa),
8
+ %w(car cur),
9
+ ].freeze
10
+
11
+ def self.create(word)
12
+ typo_list = []
13
+
14
+ PATTERN_LIST.each do |pattern|
15
+ pattern.combination(2).each do |from, to|
16
+ if word =~ /^#{from}/
17
+ typo_list << word.sub(/^#{from}/, to)
18
+ elsif word =~ /^#{to}/
19
+ typo_list << word.sub(/^#{to}/, from)
20
+ end
21
+ end
22
+ end
23
+
24
+ typo_list
25
+ end
26
+ end
27
+ end
@@ -8,6 +8,7 @@ module TypoGen
8
8
 
9
9
  typo_list |= SkipLetter.create(word)
10
10
  typo_list |= SwapLetter.create(word)
11
+ typo_list |= StartSameSound.create(word)
11
12
  typo_list |= EndSameSound.create(word)
12
13
 
13
14
  typo_list - [word]
@@ -1,3 +1,3 @@
1
1
  module TypoGen
2
- VERSION = '0.1.1'
2
+ VERSION = '0.2.0'
3
3
  end
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.description = %q{simple typo generator}
14
14
  spec.homepage = "https://github.com/siman-man/typogen"
15
15
  spec.license = "MIT"
16
- spec.required_ruby_version = '>= 2.2.0'
16
+ spec.required_ruby_version = '>= 2.0.0'
17
17
 
18
18
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
19
19
  f.match(%r{^(test|spec|features)/})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: typogen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - siman-man
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-08 00:00:00.000000000 Z
11
+ date: 2017-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -75,6 +75,7 @@ files:
75
75
  - lib/typogen/cli.rb
76
76
  - lib/typogen/end_same_sound.rb
77
77
  - lib/typogen/skip_letter.rb
78
+ - lib/typogen/start_same_sound.rb
78
79
  - lib/typogen/swap_letter.rb
79
80
  - lib/typogen/typo.rb
80
81
  - lib/typogen/version.rb
@@ -91,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
91
92
  requirements:
92
93
  - - ">="
93
94
  - !ruby/object:Gem::Version
94
- version: 2.2.0
95
+ version: 2.0.0
95
96
  required_rubygems_version: !ruby/object:Gem::Requirement
96
97
  requirements:
97
98
  - - ">="