hokkaido_dialect 0.1.0 โ†’ 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d6c15fb218d88bca4ec76ad194e6a54647fac12ba395c4b501496f5558380ed
4
- data.tar.gz: f0002e9d8e789c152403cdfa76b57d6dfd3d0e72501eb4e565e6e49b24259eaa
3
+ metadata.gz: 1a21bdc78a82d2c65385bfeec21530a9715f6432283b3c6de8001792e145b12f
4
+ data.tar.gz: 707a726e2e1c1b9d3ce90ca1bb8bdf8d6cd9aefc8af1baeccff40a13e1eae38e
5
5
  SHA512:
6
- metadata.gz: d1c8b88b164c51f0c868c72c551b63ca4e8261198153b21f4a2e5a199a988ac02243fd5fe5b92d95e6b223821bf3167e18735c42baa94880ea86aa1092fdfa97
7
- data.tar.gz: a6b9c74f1a27a498093addb714c792ea1ea45b4272854d25829cf3c68bca269ff433b90a50473f1a7ba284e4b17d90021e1d2934e4438085fe6be7bc020ff5f8
6
+ metadata.gz: 1a3dd4924d32f06b7998b60c48324379bdff51d73e4cd72ea81a2445f701ea96726fdc67b588bbde3e1a9f3fd950e29acff598f97e1b7a3d1ba27104dd9c4762
7
+ data.tar.gz: b7a07c79f2ae0397316ea74eca95d7cd8244d5f5852997f0b739b0225de7668e5e772b58be0d1c7fa74eefc82ea495d00b641d6acd18b343e5405004fed5ad3c
data/README.md CHANGED
@@ -1,38 +1,46 @@
1
1
  # HokkaidoDialect
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
4
-
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/hokkaido_dialect`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ HokkaidoDialect is a Ruby gem that provides a fun quiz to help you learn the Hokkaido dialect.
6
4
 
7
5
  ## Installation
8
6
 
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
-
11
7
  Install the gem and add to the application's Gemfile by executing:
12
8
 
13
9
  ```bash
14
- bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
10
+ bundle add hokkaido_dialect
15
11
  ```
16
12
 
17
13
  If bundler is not being used to manage dependencies, install the gem by executing:
18
14
 
19
15
  ```bash
20
- gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
16
+ gem install hokkaido_dialect
21
17
  ```
22
18
 
23
19
  ## Usage
24
20
 
25
- TODO: Write usage instructions here
21
+ Start an interactive quiz in IRB:
22
+
23
+ ```bash
24
+ % irb
25
+ irb(main):001> require 'hokkaido_dialect'
26
+ => true
27
+ irb(main):002> HokkaidoDialect::QuizGame.new.ask_and_check
28
+ => ๐Ÿฆ€๐Ÿป๐Ÿ„๐Ÿ’ซโœจ
29
+ ```
30
+
31
+ There will be multiple-choice questions on the correct usage of the Hokkaido dialect.
32
+
33
+ Enjoy the quiz and become familiar with the Hokkaido dialect!
26
34
 
27
35
  ## Development
28
36
 
29
37
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
38
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
39
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [hokkaido_dialect | RubyGems.org](https://rubygems.org/gems/hokkaido_dialect).
32
40
 
33
41
  ## Contributing
34
42
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/hokkaido_dialect.
43
+ Bug reports and pull requests are welcome on GitHub at https://github.com/lemonade-37/hokkaido_dialect.
36
44
 
37
45
  ## License
38
46
 
@@ -1,26 +1,64 @@
1
1
  module HokkaidoDialect
2
- DIALECTS = [
3
- { dialect: "ใน", correct_usage: "ใ†ใพใ„ใน๏ผŸ", wrong_usage: "ๆค…ๅญใซๅบงใ‚‹ใ‚“ใ ใน" },
4
- { dialect: "ในใ•", correct_usage: "ๅคงไธˆๅคซใ ในใ•", wrong_usage: "ใƒใ‚คใƒใ‚คใ ในใ•" },
5
- { dialect: "ในใ‚„", correct_usage: "ใŠๅ‰ใ€ใกใ‚ƒใ‚“ใจ้€ฃ็ตกใ—ใ‚ใฃใฆ่จ€ใฃใŸในใ‚„", wrong_usage: "ใ‚ใฎไบบใ‹ใฃใ“ใ„ใ„ในใ‚„" },
6
- { dialect: "ใ—ใ‚‡ใ‚„", correct_usage: "ใ”ใฟ็ฝฎใใฃใฑใชใ—ใซใ—ใชใ„ใงใฃใฆ่จ€ใฃใŸใ—ใ‚‡ใ‚„", wrong_usage: "ๆ—ญๅทใซ่กŒใใ—ใ‚‡ใ‚„" },
7
- { dialect: "ใ—ใ‚‡", correct_usage: "้‡ง่ทฏ่กŒใใฎใƒใ‚นใฃใŸใ‚‰ๆฌก3ๆ™‚้–“ๅพ…ใŸใชใ„ใจใชใ„ใ—ใ‚‡", wrong_usage: "ใ“ใชใ„ใ ๅฏŒ่‰ฏ้‡Žใซ่กŒใฃใฆใใŸใ—ใ‚‡" },
8
- { dialect: "ใชใพใ‚‰", correct_usage: "็ท ใ‚ใƒ‘ใƒ•ใ‚งใ€ใชใพใ‚‰็”˜ใ‹ใฃใŸ", wrong_usage: "ใชใพใ‚‰RubyKaigiใ ใญ" },
9
- { dialect: "ใ—ใŸใฃใ‘", correct_usage: "ใ“ใชใ„ใ ้›ชใ‹ใใ—ใŸใฃใ‘ใ€็ญ‹่‚‰็—›ใซใชใฃใŸใ•", wrong_usage: "้›ปๆฐ—ๆถˆใ—ใŸใฃใ‘" },
2
+ QUESTIONS = [
3
+ { dialect: 'ใน', correct_usage: 'ใ†ใพใ„ใน๏ผŸ', wrong_usage: 'ๆค…ๅญใซๅบงใ‚‹ใ‚“ใ ใน' },
4
+ { dialect: 'ในใ•', correct_usage: 'ๅคงไธˆๅคซใ ในใ•', wrong_usage: 'ใƒใ‚คใƒใ‚คใ ในใ•' },
5
+ { dialect: 'ในใ‚„', correct_usage: 'ใŠๅ‰ใ€ใกใ‚ƒใ‚“ใจ้€ฃ็ตกใ—ใ‚ใฃใฆ่จ€ใฃใŸในใ‚„', wrong_usage: 'ใ‚ใฎไบบใ‹ใฃใ“ใ„ใ„ในใ‚„' },
6
+ { dialect: 'ใ—ใ‚‡ใ‚„', correct_usage: 'ใ”ใฟ็ฝฎใใฃใฑใชใ—ใซใ—ใชใ„ใงใฃใฆ่จ€ใฃใŸใ—ใ‚‡ใ‚„', wrong_usage: 'ๆ—ญๅทใซ่กŒใใ—ใ‚‡ใ‚„' },
7
+ { dialect: 'ใ—ใ‚‡', correct_usage: '้‡ง่ทฏ่กŒใใฎใƒใ‚นใฃใŸใ‚‰ๆฌก3ๆ™‚้–“ๅพ…ใŸใชใ„ใจใชใ„ใ—ใ‚‡', wrong_usage: 'ใ“ใชใ„ใ ๅฏŒ่‰ฏ้‡Žใซ่กŒใฃใฆใใŸใ—ใ‚‡' },
8
+ { dialect: 'ใชใพใ‚‰', correct_usage: '็ท ใ‚ใƒ‘ใƒ•ใ‚งใ€ใชใพใ‚‰็”˜ใ‹ใฃใŸ', wrong_usage: 'ใชใพใ‚‰RubyKaigiใ ใญ' },
9
+ { dialect: 'ใ—ใŸใฃใ‘', correct_usage: 'ใ“ใชใ„ใ ้›ชใ‹ใใ—ใŸใฃใ‘ใ€็ญ‹่‚‰็—›ใซใชใฃใŸใ•', wrong_usage: '้›ปๆฐ—ๆถˆใ—ใŸใฃใ‘' },
10
+ { dialect: 'ใ—ใŸใ‚‰', correct_usage: 'ใ—ใŸใ‚‰ใญใ€ใพใŸใญ', wrong_usage: 'ใ—ใŸใ‚‰ใ€ๆฅฝใ—ใ„ใญ' },
11
+ { dialect: 'ใชใ—ใฆ', correct_usage: 'ใชใ—ใฆใใ‚“ใชใ“ใจใชใฃใŸใ‚“ใ ในใ‹', wrong_usage: 'ใชใ—ใฆใ€ใŠใฟใใ˜ๅคงๅ‰ใ ใฃใŸใ•' },
12
+ { dialect: 'ใชใ‚“ใ‚‚', correct_usage: 'ใชใ‚“ใ‚‚ใงใ™', wrong_usage: 'ใ“ใฎ่พบๆฎบ้ขจๆ™ฏใงใ€ใชใ‚“ใ‚‚ใ ใญ' },
13
+ { dialect: 'ใ€œใ•ใ‚‹', correct_usage: 'ใƒ‡ใƒผใ‚ฟใƒ™ใƒผใ‚นๅ‰Š้™คใ—ใ•ใ•ใฃใŸโ€ฆ', wrong_usage: 'ใ‚‚ใ†ใ™ใใ“ใฎๆœฌใ‚‚่ชญใฟ็ต‚ใ‚ใ‚‰ใ•ใ‚‹ใญ' },
14
+ { dialect: 'ใ—ใ‚ƒ๏ผˆใฒใ‚ƒ๏ผ‰ใฃใ“ใ„', correct_usage: 'ๆ‰‹ใ—ใ‚ƒใฃใ“๏ผ', wrong_usage: 'ใ—ใ‚ƒใฃใ“ใ„ๅๅ‰ใ ใญใ€œ' },
15
+ { dialect: 'ใ‹ใฃใกใ‚ƒใ', correct_usage: 'ๆ„›ใ—ใฆใ‚‹็Œซใซใ‹ใฃใกใ‚ƒใ‹ใ‚ŒใŸโ€ฆ', wrong_usage: 'ใ‹ใฃใกใ‚ƒใ้ฃพใ‚Šไป˜ใ‘ใ—ใ‚ˆ' },
16
+ { dialect: 'ใ‚ใ‚„', correct_usage: 'ใ‚ใ‚“ใŸใฎ้ƒจๅฑ‹ใ€ใ‚ใ‚„ใ ใญ', wrong_usage: 'ไธ€้ขใฎใƒใƒฅใƒผใƒชใƒƒใƒ—็•‘ใ€ใ‚ใ‚„ใ ใญใ€œ' },
17
+ { dialect: 'ใฏใ‚“ใ‹ใใ•ใ„', correct_usage: 'ใ‚„ใ‚ใชใ€ใฏใ‚“ใ‹ใใ•ใ„ใ‹ใ‚‰', wrong_usage: 'ใ“ใฎ้ƒจๅฑ‹ใ€ใฏใ‚“ใ‹ใใ•ใ„ใช' },
18
+ { dialect: 'ใ„ใšใ„', correct_usage: 'ใ“ใฎใƒ‹ใƒƒใƒˆใกใใกใใ—ใฆใ„ใšใ„', wrong_usage: 'ใกใ‚‡ใฃใจใ‚ซใƒฉใ‚ชใ‚ฑใ„ใšใ„ใ‹ใ‚‰ๅธฐใ‚ใ†ใ‹ใช' },
19
+ { dialect: 'ใ‚ใšใพใ—ใ„', correct_usage: 'ใ‚ใšใพใ—ใใชใ„ใญ', wrong_usage: 'ใ‚ใฎๅญใ€ใ‚ใฃใกใ‚ƒใ‚ใšใพใ—ใ„' },
20
+ { dialect: 'ใฏใ', correct_usage: 'ใปใ‚‰ใ€ๆ—ฉใๆ‰‹่ข‹ใฏใใช', wrong_usage: 'ๅบŠใฏใ„ใฆใŠใ„ใฆ' },
21
+ { dialect: 'ใ“ใ‚ใ„', correct_usage: 'ใ“ใ‚ใ„ใ‚“ใงใ—ใ‚‡ใ€ไผ‘ใ‚“ใงใช', wrong_usage: 'ใƒ’ใ‚ฐใƒžใ€ใ“ใ‚ใ„' },
22
+ { dialect: 'ใกใ‚‡ใ™', correct_usage: 'ใกใ‚‡ใ™ใชใ—', wrong_usage: 'ใ‚„ใฃใปใƒผ๏ผใกใ‚‡ใ™๏ผ' },
23
+ { dialect: 'ใ†ใ‚‹ใ‹ใ™', correct_usage: '้ฃŸใน็ต‚ใ‚ใฃใŸ้ฃŸๅ™จใ†ใ‚‹ใ‹ใ—ใจใ„ใฆ', wrong_usage: '็›ฎใŒใ†ใ‚‹ใ‹ใ•ใฃใฆใใŸ' },
24
+ { dialect: 'ใŠใฃใกใ‚ƒใ‚“ใ“', correct_usage: 'ไธŠๆ‰‹ใซใŠใฃใกใ‚ƒใ‚“ใ“ใ—ใฆใ€ใ‚ใ‚“ใ“ใ„ใญ', wrong_usage: 'ใŠใฃใกใ‚ƒใ‚“ใ“ใ—ใฆ้ ‚ใ„ใฆใ„ใ„ใงใ™ใ‹๏ผŸ' },
25
+ { dialect: 'ใผใฃใ“', correct_usage: 'ใ“ใฎใผใฃใ“ใ‚’ใ€้‡ฃ็ซฟใจใ™ใ‚‹', wrong_usage: 'ใฒใชใŸใผใฃใ“' },
26
+ { dialect: 'ใ‚ใŸใ‚‹', correct_usage: 'ใŠๅผๅฝ“1ไบบ1ใคใ‚ใŸใ‚‹ใ‹ใ‚‰ใญ', wrong_usage: '็”Ÿ็‰ก่ ฃ้ฃŸในใฆใ‚ใŸใฃใŸ' }
10
27
  ]
11
28
 
12
- class Question
13
- def self.ask
14
- dialect = DIALECTS.sample
15
- correct_usage = dialect[:correct_usage]
16
- incorrect_usage = dialect[:wrong_usage]
29
+ class QuizGame
30
+ def initialize
31
+ question = QUESTIONS.sample
32
+ wrong_usage = question[:wrong_usage]
33
+ @dialect = question[:dialect]
34
+ @correct_usage = question[:correct_usage]
35
+ @choices = [wrong_usage, @correct_usage].shuffle
36
+ end
37
+
38
+ def ask_and_check
39
+ puts ask
40
+ print '็•ชๅทใ‚’ๅ…ฅๅŠ›ใ—ใฆใใ ใ•ใ„๏ผˆ1 or 2๏ผ‰: '
41
+ input = $stdin.gets.to_i
42
+
43
+ unless [1, 2].include?(input)
44
+ puts '็„กๅŠนใชๅ…ฅๅŠ›ใงใ™๏ผ1ใพใŸใฏ2ใ‚’ๅ…ฅๅŠ›ใ—ใฆใใ ใ•ใ„๐Ÿป'
45
+ return
46
+ end
17
47
 
18
- choices = [correct_usage, incorrect_usage].shuffle
48
+ if correct_answer?(input)
49
+ puts 'ๆญฃ่งฃ๏ผ๐ŸŽ‰โœจ๐Ÿฆ€'
50
+ else
51
+ puts 'ไธๆญฃ่งฃโ€ฆ๐Ÿ„'
52
+ end
53
+ end
54
+
55
+ def ask
56
+ "ๆฌกใฎๆ–‡็ซ ใงๆญฃใ—ใ„ใ€Œ#{@dialect}ใ€ใฎไฝฟใ„ๆ–นใฏใฉใฃใก๏ผŸ\n1. #{@choices[0]}\n2. #{@choices[1]}"
57
+ end
19
58
 
20
- {
21
- question: "ๆฌกใฎๆ–‡็ซ ใงๆญฃใ—ใ„ๅŒ—ๆตท้“ๅผใฏใฉใฃใก๏ผŸ\n1. #{choices[0]}\n2. #{choices[1]}",
22
- answer: choices.index(correct_usage) + 1
23
- }
59
+ def correct_answer?(input)
60
+ index = input - 1
61
+ @choices[index] == @correct_usage
24
62
  end
25
63
  end
26
64
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HokkaidoDialect
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "hokkaido_dialect/version"
4
+ require_relative "hokkaido_dialect/hokkaido_dialect"
4
5
 
5
6
  module HokkaidoDialect
6
7
  class Error < StandardError; end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hokkaido_dialect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - lemonade_37
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-04-18 00:00:00.000000000 Z
10
+ date: 2025-05-08 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: ๆœฌ็‰ฉใฎๅŒ—ๆตท้“ๅผใจใ‚จใ‚ปๅŒ—ๆตท้“ๅผใ‚’่ฆ‹ๅˆ†ใ‘ใ‚‹ใ‚ฏใ‚คใ‚บใงใ™ใ€‚
13
13
  executables: []