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 +4 -4
- data/README.md +18 -10
- data/lib/hokkaido_dialect/hokkaido_dialect.rb +56 -18
- data/lib/hokkaido_dialect/version.rb +1 -1
- data/lib/hokkaido_dialect.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a21bdc78a82d2c65385bfeec21530a9715f6432283b3c6de8001792e145b12f
|
4
|
+
data.tar.gz: 707a726e2e1c1b9d3ce90ca1bb8bdf8d6cd9aefc8af1baeccff40a13e1eae38e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a3dd4924d32f06b7998b60c48324379bdff51d73e4cd72ea81a2445f701ea96726fdc67b588bbde3e1a9f3fd950e29acff598f97e1b7a3d1ba27104dd9c4762
|
7
|
+
data.tar.gz: b7a07c79f2ae0397316ea74eca95d7cd8244d5f5852997f0b739b0225de7668e5e772b58be0d1c7fa74eefc82ea495d00b641d6acd18b343e5405004fed5ad3c
|
data/README.md
CHANGED
@@ -1,38 +1,46 @@
|
|
1
1
|
# HokkaidoDialect
|
2
2
|
|
3
|
-
|
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
|
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
|
16
|
+
gem install hokkaido_dialect
|
21
17
|
```
|
22
18
|
|
23
19
|
## Usage
|
24
20
|
|
25
|
-
|
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 [
|
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/
|
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
|
-
|
3
|
-
{ dialect:
|
4
|
-
{ dialect:
|
5
|
-
{ dialect:
|
6
|
-
{ dialect:
|
7
|
-
{ dialect:
|
8
|
-
{ dialect:
|
9
|
-
{ dialect:
|
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
|
13
|
-
def
|
14
|
-
|
15
|
-
|
16
|
-
|
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
|
-
|
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
|
-
|
22
|
-
|
23
|
-
}
|
59
|
+
def correct_answer?(input)
|
60
|
+
index = input - 1
|
61
|
+
@choices[index] == @correct_usage
|
24
62
|
end
|
25
63
|
end
|
26
64
|
end
|
data/lib/hokkaido_dialect.rb
CHANGED
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.
|
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-
|
10
|
+
date: 2025-05-08 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: ๆฌ็ฉใฎๅๆตท้ๅผใจใจใปๅๆตท้ๅผใ่ฆๅใใใฏใคใบใงใใ
|
13
13
|
executables: []
|