hiq 0.2.3 → 0.4.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
  SHA256:
3
- metadata.gz: 01f5f0694196e980cd36d86d7c3995d05a72548230a37b513570ee0c5faed998
4
- data.tar.gz: b67a7324ae0deb31451a7797ba27af9127ef743669259743a7c7e4a6ef0553ef
3
+ metadata.gz: e278cf61506328969bb1c100a9067383a2e0febf7cc00153fdc595009bb69eff
4
+ data.tar.gz: e55721a60aadba8cbb93c167d1110fa66da739f3369e04efea06e9b4e648d8e4
5
5
  SHA512:
6
- metadata.gz: '0803d7976ba63d812f742c4d400cce9e1b61e182ea93c925023d08ed3b1dad520e653f808ddac05056ac89de994701f0c921f999d8fb2edb607005c19fa77b9b'
7
- data.tar.gz: 62b8b18edca28bec99356dfc502c904f9dcb1c9aa125ca4d0fdd3e8e0e8abf0f9117db13a822cf892a926d42b7b8caa876920bfd69faf1a9b8d7902fc51884f7
6
+ metadata.gz: 0d04308dd35f1591449bdbb4bd936a6d2d975f7376b368fd5909971645f6a6dd0dd78591217502fe6ac71c36337cabf25d85ddbf82827b904c01359dbe1afc14
7
+ data.tar.gz: a0dbf5658dedec1d7734efc7308b91cf5d031c60d10a6c45d1819e1dcf6a1b5fe5e41d7ec733de4acf8ba30764785fb24b6df85ba517be2bc38249e407f3e0eb
data/bin/haiku ADDED
@@ -0,0 +1,6 @@
1
+ # !/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'hiq'
5
+
6
+ puts Hiq.haiku(*ARGV[0..2])
@@ -1,23 +1,114 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # rubocop:disable Metrics/MethodLength
4
+ # rubocop:disable Metrics/ClassLength
5
+
3
6
  module Hiq
4
7
  # Provided of filler for lines of haiku
5
8
  class FillerLibrary
6
9
  def self.interpolated_fillers
7
10
  {
8
- 1 => ['the X', 'a X'],
9
- 2 => ['ghastly X', 'the pale X'],
10
- 3 => ['shadow of X', 'X in silence'],
11
- 4 => ['X of my joy fade', 'X ends the autumn'],
12
- 5 => ['A spark of X above'],
13
- 6 => ['the sad facade of X torn']
11
+ 1 => ['the X', 'a X', 'X house!'],
12
+ 2 => ['ghastly X', 'the pale X', 'fog X mince', 'No X jay', 'X the bottle', 'younger X', 'X bark tight',
13
+ 'with a X winds'],
14
+ 3 => ['shadow of X', 'X in silence', 'the subway X', 'In the pink X', 'behind an X', 'it bus X moon',
15
+ 'X the pages'],
16
+ 4 => ['X of my joy fade', 'X ends the autumn', 'letter to the X', 'X in the window', 'the lines of X',
17
+ 'the X scattered', 'flat fine go X call', 'from the childhood X'],
18
+ 5 => ['A spark of X above', 'Slayer wind the way X'],
19
+ 6 => ['the sad facade of X torn', 'afternoon from I wall X', 'X trees flutter over back ']
14
20
  }
15
21
  end
16
22
 
17
23
  def self.fillers
18
24
  {
19
- 5 => ['empty riverside', 'tears flow in the rain', 'cheerful summer\'s charm'],
20
- 7 => ['the vain wind of summer blows', 'gentle breeze upon a mountain', 'a frog jumps into a well']
25
+ 5 => [
26
+ 'empty riverside',
27
+ 'tears flow in the rain',
28
+ 'cheerful summer\'s charm',
29
+ 'A fallen leaves',
30
+ "New Year's 1ever",
31
+ 'of a dog hanged',
32
+ 'on the pavement',
33
+ "Valentine's Day",
34
+ 'a shadow boating',
35
+ 'airily balloons -',
36
+ 'cup on tea music',
37
+ 'evening coolness',
38
+ 'finally ad bass -',
39
+ 'override my amps',
40
+ 'A head lit shelter',
41
+ 'a bark flower pot',
42
+ 'and there escapes',
43
+ 'fan into too fast',
44
+ 'in the holy sense',
45
+ 'inside the sunset',
46
+ 'listening to down',
47
+ 'on a bird fingers',
48
+ 'the bag of autumn',
49
+ 'the bay of a dart',
50
+ 'the colored world',
51
+ 'after the pumpkin:',
52
+ 'at the sudden hair',
53
+ 'autumn leaf flames',
54
+ 'comes to an end...',
55
+ 'for the sun alone',
56
+ 'in the young weirs',
57
+ 'on a garbage truck',
58
+ 'snow fall of roses',
59
+ 'the saddled slower',
60
+ 'a wash before sheep',
61
+ 'affords hot the air',
62
+ 'in the Honkers mine',
63
+ 'in the fall flowing',
64
+ 'milk in the morning',
65
+ 'someone older bloom',
66
+ 'the ash leaves splay',
67
+ 'the lift of a moor,',
68
+ 'the same quiet rains',
69
+ '- A hole in the rise',
70
+ 'October wind through',
71
+ 'headlights, whiter-et',
72
+ 'i- two gold her hair',
73
+ 'just up kin oil beard',
74
+ 'passing my neighbor',
75
+ 'pierce drippy second',
76
+ 'shells in the mirror',
77
+ 'the sound of a trash',
78
+ 'the wild powder sack',
79
+ 'the mister rams trap',
80
+ 'from the first baleen',
81
+ 'my mind like a candle',
82
+ 'snow, leaves two pies',
83
+ 'the scent of red hair',
84
+ 'a flank of calm mosque',
85
+ 'a fan a across',
86
+ "sin's that dawn light tide"
87
+ ],
88
+ 7 => [
89
+ 'the vain wind of summer blows',
90
+ 'gentle breeze upon a mountain',
91
+ 'a frog jumps into a well',
92
+ 'around my of finally',
93
+ 'roses in the forecast',
94
+ 'follow just overflowed',
95
+ 'of a traveling machine',
96
+ 'of allowed in the blade',
97
+ 'under a clamping lilac -',
98
+ 'on the Pony.. and snuffer',
99
+ 'the blinded on a red road',
100
+ 'the scent of lemon petals',
101
+ 'the islands in the grab use',
102
+ 'the noise of a carrier bag',
103
+ 'young women clean morning -',
104
+ 'an expecting moon His breaks',
105
+ 'the boyfriend of my pocket -',
106
+ 'Spring warding stray or a glass',
107
+ 'and two pour face all the dock',
108
+ 'i wish i X on buy band train',
109
+ 'in the fresh of old plane candle',
110
+ "we're down the school of her hands"
111
+ ]
21
112
  }
22
113
  end
23
114
 
@@ -37,3 +128,5 @@ module Hiq
37
128
  end
38
129
  end
39
130
  end
131
+ # rubocop:enable Metrics/MethodLength
132
+ # rubocop:enable Metrics/ClassLength
@@ -29,8 +29,12 @@ module Hiq
29
29
  target_syllable_length - line.map { |word| syllables(word) }.sum
30
30
  end
31
31
 
32
+ def vowelless_input?
33
+ syllable_gap_size == target_syllable_length
34
+ end
35
+
32
36
  def filled_line
33
- return [library.get_const_filler(target_syllable_length)] if line.empty?
37
+ return [library.get_const_filler(target_syllable_length)] if line.empty? || vowelless_input?
34
38
 
35
39
  [library.get_interpolated_filler(syllable_gap_size).gsub('X', line.first)]
36
40
  end
data/lib/hiq/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hiq
4
- VERSION = '0.2.3'
4
+ VERSION = '0.4.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Taras
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-27 00:00:00.000000000 Z
11
+ date: 2022-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -82,10 +82,12 @@ dependencies:
82
82
  version: 1.26.0
83
83
  description: A simple Haiku generator gem
84
84
  email: jan.taras29@gmail.com
85
- executables: []
85
+ executables:
86
+ - haiku
86
87
  extensions: []
87
88
  extra_rdoc_files: []
88
89
  files:
90
+ - bin/haiku
89
91
  - lib/hiq.rb
90
92
  - lib/hiq/domain/filler_library.rb
91
93
  - lib/hiq/domain/line_composer.rb