Compare commits
	
		
			No commits in common. "f6839fe42ae14623f924f65ca52bc9b8e5b42c21" and "6612483ac437fc2e548d89255c163bb5ee54b902" have entirely different histories.
		
	
	
		
			f6839fe42a
			...
			6612483ac4
		
	
		
							
								
								
									
										11
									
								
								Gemfile
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								Gemfile
									
									
									
									
									
								
							| @ -1,11 +0,0 @@ | |||||||
| # frozen_string_literal: true |  | ||||||
| 
 |  | ||||||
| source "https://rubygems.org" |  | ||||||
| 
 |  | ||||||
| gem "discordrb" |  | ||||||
| gem "rufus-scheduler" |  | ||||||
| 
 |  | ||||||
| group "test" do |  | ||||||
|   gem "rspec" |  | ||||||
|   gem "minitest" |  | ||||||
| end |  | ||||||
							
								
								
									
										76
									
								
								Gemfile.lock
									
									
									
									
									
								
							
							
						
						
									
										76
									
								
								Gemfile.lock
									
									
									
									
									
								
							| @ -1,76 +0,0 @@ | |||||||
| GEM |  | ||||||
|   remote: https://rubygems.org/ |  | ||||||
|   specs: |  | ||||||
|     base64 (0.3.0) |  | ||||||
|     concurrent-ruby (1.3.5) |  | ||||||
|     diff-lcs (1.6.2) |  | ||||||
|     discordrb (3.5.0) |  | ||||||
|       discordrb-webhooks (~> 3.5.0) |  | ||||||
|       ffi (>= 1.9.24) |  | ||||||
|       opus-ruby |  | ||||||
|       rest-client (>= 2.0.0) |  | ||||||
|       websocket-client-simple (>= 0.3.0) |  | ||||||
|     discordrb-webhooks (3.5.0) |  | ||||||
|       rest-client (>= 2.0.0) |  | ||||||
|     domain_name (0.6.20240107) |  | ||||||
|     et-orbi (1.3.0) |  | ||||||
|       tzinfo |  | ||||||
|     event_emitter (0.2.6) |  | ||||||
|     ffi (1.17.2) |  | ||||||
|     fugit (1.11.1) |  | ||||||
|       et-orbi (~> 1, >= 1.2.11) |  | ||||||
|       raabro (~> 1.4) |  | ||||||
|     http-accept (1.7.0) |  | ||||||
|     http-cookie (1.0.8) |  | ||||||
|       domain_name (~> 0.5) |  | ||||||
|     logger (1.7.0) |  | ||||||
|     mime-types (3.7.0) |  | ||||||
|       logger |  | ||||||
|       mime-types-data (~> 3.2025, >= 3.2025.0507) |  | ||||||
|     mime-types-data (3.2025.0812) |  | ||||||
|     minitest (5.25.5) |  | ||||||
|     mutex_m (0.3.0) |  | ||||||
|     netrc (0.11.0) |  | ||||||
|     opus-ruby (1.0.1) |  | ||||||
|       ffi |  | ||||||
|     raabro (1.4.0) |  | ||||||
|     rest-client (2.1.0) |  | ||||||
|       http-accept (>= 1.7.0, < 2.0) |  | ||||||
|       http-cookie (>= 1.0.2, < 2.0) |  | ||||||
|       mime-types (>= 1.16, < 4.0) |  | ||||||
|       netrc (~> 0.8) |  | ||||||
|     rspec (3.13.1) |  | ||||||
|       rspec-core (~> 3.13.0) |  | ||||||
|       rspec-expectations (~> 3.13.0) |  | ||||||
|       rspec-mocks (~> 3.13.0) |  | ||||||
|     rspec-core (3.13.5) |  | ||||||
|       rspec-support (~> 3.13.0) |  | ||||||
|     rspec-expectations (3.13.5) |  | ||||||
|       diff-lcs (>= 1.2.0, < 2.0) |  | ||||||
|       rspec-support (~> 3.13.0) |  | ||||||
|     rspec-mocks (3.13.5) |  | ||||||
|       diff-lcs (>= 1.2.0, < 2.0) |  | ||||||
|       rspec-support (~> 3.13.0) |  | ||||||
|     rspec-support (3.13.4) |  | ||||||
|     rufus-scheduler (3.9.2) |  | ||||||
|       fugit (~> 1.1, >= 1.11.1) |  | ||||||
|     tzinfo (2.0.6) |  | ||||||
|       concurrent-ruby (~> 1.0) |  | ||||||
|     websocket (1.2.11) |  | ||||||
|     websocket-client-simple (0.9.0) |  | ||||||
|       base64 |  | ||||||
|       event_emitter |  | ||||||
|       mutex_m |  | ||||||
|       websocket |  | ||||||
| 
 |  | ||||||
| PLATFORMS |  | ||||||
|   x86_64-linux |  | ||||||
| 
 |  | ||||||
| DEPENDENCIES |  | ||||||
|   discordrb |  | ||||||
|   minitest |  | ||||||
|   rspec |  | ||||||
|   rufus-scheduler |  | ||||||
| 
 |  | ||||||
| BUNDLED WITH |  | ||||||
|    2.4.19 |  | ||||||
| @ -1,5 +1,3 @@ | |||||||
| require "rufus-scheduler" |  | ||||||
| 
 |  | ||||||
| DEFAULT_LESSON_PLAN = [ | DEFAULT_LESSON_PLAN = [ | ||||||
|   [15, "login and catch up on the week"], |   [15, "login and catch up on the week"], | ||||||
|   [45, "review chapter vocab and grammar"], |   [45, "review chapter vocab and grammar"], | ||||||
| @ -8,34 +6,30 @@ DEFAULT_LESSON_PLAN = [ | |||||||
| ] | ] | ||||||
| 
 | 
 | ||||||
| class Lesson | class Lesson | ||||||
|   attr_reader :lesson_plan, :channel, :thread, :running, :scheduler |   attr_reader :lesson_plan, :channel, :thread, :running | ||||||
| 
 | 
 | ||||||
|   def initialize(lesson_plan=DEFAULT_LESSON_PLAN, scheduler: Rufus::Scheduler.new) |   def initialize(lesson_plan=DEFAULT_LESSON_PLAN) | ||||||
|     @lesson_plan = lesson_plan |     @lesson_plan = lesson_plan | ||||||
|     @running = false |     @running = false | ||||||
|     @scheduler = scheduler |  | ||||||
|   end |   end | ||||||
| 
 | 
 | ||||||
|   def stop! |   def stop! | ||||||
|     @scheduler.shutdown |     thread.kill if thread | ||||||
|   end |  | ||||||
| 
 |  | ||||||
|   def start!(channel) |  | ||||||
|     lesson_plan.each_with_index do |(time, message), index| |  | ||||||
|       offset = lesson_plan.map(&:first)[0..index - 1].sum(0) |  | ||||||
|       offset = 0 if index == 0 |  | ||||||
|       scheduler.in "#{offset}m" do |  | ||||||
|         channel.send_message "#{time} minutes to #{message}" |  | ||||||
|       end |  | ||||||
|     end |  | ||||||
| 
 |  | ||||||
|     end_offset = lesson_plan.map(&:first).sum(0) |  | ||||||
|     scheduler.in "#{end_offset}m" do |  | ||||||
|       channel.send_message "Lesson over!" |  | ||||||
|     @running = false |     @running = false | ||||||
|   end |   end | ||||||
| 
 | 
 | ||||||
|  |   def start!(channel) | ||||||
|  |     stop! | ||||||
|  |     @channel = channel | ||||||
|  |     @thread = Thread.new do | ||||||
|       @running = true |       @running = true | ||||||
|  |       lesson_plan.each do |time, message| | ||||||
|  |         channel.send_message "#{time} minutes to #{message}" | ||||||
|  |         sleep(time * 60) | ||||||
|  |       end | ||||||
|  |       channel.send_message "Lesson over!" | ||||||
|  |       @running = false | ||||||
|  |     end | ||||||
|   end |   end | ||||||
| 
 | 
 | ||||||
|   def running? |   def running? | ||||||
|  | |||||||
							
								
								
									
										211
									
								
								lib/verb.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										211
									
								
								lib/verb.rb
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,211 @@ | |||||||
|  | U_VOWEL_CHANGES = { | ||||||
|  |   "る" => { "a" => "ら", "i" => "り", "u" => "る", "e" => "れ", "o" => "ろ" }, | ||||||
|  |   "う" => { "a" => "あ", "i" => "い", "u" => "う", "e" => "え", "o" => "お" }, | ||||||
|  |   "つ" => { "a" => "た", "i" => "ち", "u" => "つ", "e" => "て", "o" => "と" }, | ||||||
|  |   "す" => { "a" => "さ", "i" => "し", "u" => "す", "e" => "せ", "o" => "そ" }, | ||||||
|  |   "く" => { "a" => "か", "i" => "き", "u" => "く", "e" => "け", "o" => "こ" }, | ||||||
|  |   "ぐ" => { "a" => "が", "i" => "ぎ", "u" => "ぐ", "e" => "げ", "o" => "ご" }, | ||||||
|  |   "ぶ" => { "a" => "ば", "i" => "び", "u" => "ぶ", "e" => "べ", "o" => "ぼ" }, | ||||||
|  |   "む" => { "a" => "ま", "i" => "み", "u" => "む", "e" => "め", "o" => "も" }, | ||||||
|  |   "ぬ" => { "a" => "な", "i" => "に", "u" => "ぬ", "e" => "ね", "o" => "の" }, | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | TE_TA_DE_DA = { | ||||||
|  |   "て" => "た", "で" => "だ" | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | class KanaKanji | ||||||
|  |   attr_reader :kana, :kanji | ||||||
|  |   def initialize(kana, kanji=nil) | ||||||
|  |     @kana = kana | ||||||
|  |     @kanji = kanji || kana | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def [](index) | ||||||
|  |     self.class.new kana[index], kanji[index] | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def +(other) | ||||||
|  |     case other | ||||||
|  |     when String | ||||||
|  |       self.class.new kana + other, kanji + other | ||||||
|  |     when KanaKanji | ||||||
|  |       self.class.new kana + other.kana, kanji + other.kanji | ||||||
|  |     end | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def last_character(new_form=nil) | ||||||
|  |     return kana[-1] unless new_form | ||||||
|  |     U_VOWEL_CHANGES[kana[-1]][new_form] | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def all_but_last_character | ||||||
|  |     self.class.new kana[0...-1], kanji[0...-1] | ||||||
|  |   end | ||||||
|  | end | ||||||
|  | 
 | ||||||
|  | class Verb | ||||||
|  |   attr_reader :dict_kanji, :dict_kana, :definition, :dict | ||||||
|  | 
 | ||||||
|  |   def initialize(dict_kanji, dict_kana, definition) | ||||||
|  |     @dict_kanji = dict_kanji || dict_kana | ||||||
|  |     @dict_kana = dict_kana | ||||||
|  |     @dict = KanaKanji.new dict_kana, dict_kanji | ||||||
|  |     @definition = definition | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def last_character(new_form=nil) | ||||||
|  |     dict.last_character(new_form) | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def all_but_last_character | ||||||
|  |     dict.all_but_last_character | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def dictionary | ||||||
|  |     dict | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def long_form_present_positive | ||||||
|  |     stem + "ます" | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def long_form_present_negative | ||||||
|  |     stem + "ません" | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def long_form_past_positive | ||||||
|  |     stem + "ました" | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def long_form_past_negative | ||||||
|  |     long_form_present_negative + "でした" | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def short_form_present_positive | ||||||
|  |     dictionary | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def short_form_present_negative | ||||||
|  |     negative_stem + "ない" | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def short_form_past_positive | ||||||
|  |     te.all_but_last_character + TE_TA_DE_DA[te.last_character] | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def short_form_past_negative | ||||||
|  |     short_form_present_negative.all_but_last_character + "かった" | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def desire | ||||||
|  |     stem + "たい" | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def potential | ||||||
|  |     IchidanVerb.new(potential_starter.kanji, potential_starter.kana, "to be able #{definition}") | ||||||
|  |   end | ||||||
|  | end | ||||||
|  | 
 | ||||||
|  | class IchidanVerb < Verb | ||||||
|  |   def stem | ||||||
|  |     all_but_last_character | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def negative_stem | ||||||
|  |     stem | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def te | ||||||
|  |     all_but_last_character + "て" | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def potential_starter | ||||||
|  |     stem + "られる" | ||||||
|  |   end | ||||||
|  | end | ||||||
|  | 
 | ||||||
|  | class GodanVerb < Verb | ||||||
|  |   def iku? | ||||||
|  |     dict.kanji == "行く" | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def stem | ||||||
|  |     all_but_last_character + last_character("i") | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def negative_stem | ||||||
|  |     all_but_last_character + last_character("a") | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def potential_starter | ||||||
|  |     all_but_last_character + last_character("e") + "る" | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def te | ||||||
|  |     all_but_last_character + case last_character | ||||||
|  |                              when "う" | ||||||
|  |                                "って" | ||||||
|  |                              when "る" | ||||||
|  |                                "って" | ||||||
|  |                              when "つ" | ||||||
|  |                                "って" | ||||||
|  |                              when "す" | ||||||
|  |                                "して" | ||||||
|  |                              when "く" | ||||||
|  |                                iku? ? "って" : "いて" | ||||||
|  |                              when "ぐ" | ||||||
|  |                                "いで" | ||||||
|  |                              when "ぶ" | ||||||
|  |                                "んで" | ||||||
|  |                              when "む" | ||||||
|  |                                "んで" | ||||||
|  |                              when "ぬ" | ||||||
|  |                                "んで" | ||||||
|  |                              end | ||||||
|  |   end | ||||||
|  | end | ||||||
|  | 
 | ||||||
|  | class SuruVerb < Verb | ||||||
|  |   def prefix | ||||||
|  |     dict[..-3] | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def stem | ||||||
|  |     prefix + "し" | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def negative_stem | ||||||
|  |     prefix + "し" | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def te | ||||||
|  |     prefix + "して" | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def potential_starter | ||||||
|  |     prefix + "できる" | ||||||
|  |   end | ||||||
|  | end | ||||||
|  | 
 | ||||||
|  | class KuruVerb < Verb | ||||||
|  |   def prefix | ||||||
|  |     dict[..-3] | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def te | ||||||
|  |     stem + "て" | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def stem | ||||||
|  |     prefix + KanaKanji.new("き", "来") | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def negative_stem | ||||||
|  |     prefix + KanaKanji.new("こ", "来") | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def potential_starter | ||||||
|  |     negative_stem + "られる" | ||||||
|  |   end | ||||||
|  | end | ||||||
| @ -3,14 +3,20 @@ require "minitest/autorun" | |||||||
| 
 | 
 | ||||||
| class TestLesson < Minitest::Test | class TestLesson < Minitest::Test | ||||||
|   def setup |   def setup | ||||||
|     @scheduler = Minitest::Mock.new |     @lesson = Lesson.new [[0.1 / 60, "test the thing"], [0.1 / 60, "finish testing"]] | ||||||
|   end |   end | ||||||
| 
 | 
 | ||||||
|   def test_start |   def test_start | ||||||
|     @lesson = Lesson.new [[1, "test the thing"], [3, "finish testing"]], scheduler: @scheduler |     @channel = Minitest::Mock.new | ||||||
|     @scheduler.expect(:in, nil) { |time| time == "0m" } |     @channel.expect(:send_message, nil) { |msg| msg.include? "to test the thing" } | ||||||
|     @scheduler.expect(:in, nil) { |time| time == "1m" } |     @channel.expect(:send_message, nil) { |msg| msg.include? "to finish testing" } | ||||||
|     @scheduler.expect(:in, nil) { |time| time == "4m" } |     @channel.expect(:send_message, nil) { |msg| msg == "Lesson over!" } | ||||||
|     @lesson.start! nil |     assert_equal false, @lesson.running | ||||||
|  |     @lesson.start!(@channel) | ||||||
|  |     sleep(0.5) | ||||||
|  |     # gonna be impossible to thread this needle | ||||||
|  |     # assert_equal true, @lesson.running | ||||||
|  |     sleep(0.5) | ||||||
|  |     assert_equal false, @lesson.running | ||||||
|   end |   end | ||||||
| end | end | ||||||
|  | |||||||
							
								
								
									
										198
									
								
								test/test_verb.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										198
									
								
								test/test_verb.rb
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,198 @@ | |||||||
|  | require_relative "../lib/verb" | ||||||
|  | require "minitest/autorun" | ||||||
|  | 
 | ||||||
|  | class TestVerb < Minitest::Test | ||||||
|  |   def setup | ||||||
|  |     @miru = IchidanVerb.new("見る", "みる", "to look") | ||||||
|  |     @nomu = GodanVerb.new("飲む", "のむ", "to drink") | ||||||
|  |     @au = GodanVerb.new("会う", "あう", "to meet") | ||||||
|  |     @matsu = GodanVerb.new("待つ", "まつ", "to wait") | ||||||
|  |     @toru = GodanVerb.new("取る", "とる", "to take") | ||||||
|  |     @yomu = GodanVerb.new("読む", "よむ", "to read") | ||||||
|  |     @asobu = GodanVerb.new("遊ぶ", "あそぶ", "to play") | ||||||
|  |     @shinu = GodanVerb.new("死ぬ", "しぬ", "to die") | ||||||
|  |     @kaku = GodanVerb.new("書く", "かく", "to write") | ||||||
|  |     @iku = GodanVerb.new("行く", "いく", "to go") | ||||||
|  |     @oyogu = GodanVerb.new("泳ぐ", "およぐ", "to swim") | ||||||
|  |     @hanasu = GodanVerb.new("話す", "はなす", "to speak") | ||||||
|  |     @suru = SuruVerb.new("する", "する", "to do") | ||||||
|  |     @benkyousuru = SuruVerb.new("勉強する", "べんきょうする", "to study") | ||||||
|  |     @kuru = KuruVerb.new("来る", "くる", "to come") | ||||||
|  |     @tsuretekuru = KuruVerb.new("連れて来る", "つれてくる", "to bring somebody along") | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def test_te_form | ||||||
|  |     assert_equal "見て", @miru.te.kanji | ||||||
|  |     assert_equal "みて", @miru.te.kana | ||||||
|  |     assert_equal "飲んで", @nomu.te.kanji | ||||||
|  |     assert_equal "のんで", @nomu.te.kana | ||||||
|  |     assert_equal "して", @suru.te.kanji | ||||||
|  |     assert_equal "して", @suru.te.kana | ||||||
|  |     assert_equal "勉強して", @benkyousuru.te.kanji | ||||||
|  |     assert_equal "べんきょうして", @benkyousuru.te.kana | ||||||
|  |     assert_equal "会って", @au.te.kanji | ||||||
|  |     assert_equal "待って", @matsu.te.kanji | ||||||
|  |     assert_equal "取って", @toru.te.kanji | ||||||
|  |     assert_equal "読んで", @yomu.te.kanji | ||||||
|  |     assert_equal "遊んで", @asobu.te.kanji | ||||||
|  |     assert_equal "死んで", @shinu.te.kanji | ||||||
|  |     assert_equal "書いて", @kaku.te.kanji | ||||||
|  |     assert_equal "行って", @iku.te.kanji | ||||||
|  |     assert_equal "泳いで", @oyogu.te.kanji | ||||||
|  |     assert_equal "話して", @hanasu.te.kanji | ||||||
|  |     assert_equal "来て", @kuru.te.kanji | ||||||
|  |     assert_equal "きて", @kuru.te.kana | ||||||
|  |     assert_equal "連れて来て", @tsuretekuru.te.kanji | ||||||
|  |     assert_equal "つれてきて", @tsuretekuru.te.kana | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def test_long_form_present_positive | ||||||
|  |     assert_equal "見ます", @miru.long_form_present_positive.kanji | ||||||
|  |     assert_equal "みます", @miru.long_form_present_positive.kana | ||||||
|  |     assert_equal "飲みます", @nomu.long_form_present_positive.kanji | ||||||
|  |     assert_equal "のみます", @nomu.long_form_present_positive.kana | ||||||
|  |     assert_equal "します", @suru.long_form_present_positive.kanji | ||||||
|  |     assert_equal "します", @suru.long_form_present_positive.kana | ||||||
|  |     assert_equal "勉強します", @benkyousuru.long_form_present_positive.kanji | ||||||
|  |     assert_equal "べんきょうします", @benkyousuru.long_form_present_positive.kana | ||||||
|  |     assert_equal "来ます", @kuru.long_form_present_positive.kanji | ||||||
|  |     assert_equal "きます", @kuru.long_form_present_positive.kana | ||||||
|  |     assert_equal "連れて来ます", @tsuretekuru.long_form_present_positive.kanji | ||||||
|  |     assert_equal "つれてきます", @tsuretekuru.long_form_present_positive.kana | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def test_long_form_present_negative | ||||||
|  |     assert_equal "見ません", @miru.long_form_present_negative.kanji | ||||||
|  |     assert_equal "みません", @miru.long_form_present_negative.kana | ||||||
|  |     assert_equal "飲みません", @nomu.long_form_present_negative.kanji | ||||||
|  |     assert_equal "のみません", @nomu.long_form_present_negative.kana | ||||||
|  |     assert_equal "しません", @suru.long_form_present_negative.kanji | ||||||
|  |     assert_equal "しません", @suru.long_form_present_negative.kana | ||||||
|  |     assert_equal "勉強しません", @benkyousuru.long_form_present_negative.kanji | ||||||
|  |     assert_equal "べんきょうしません", @benkyousuru.long_form_present_negative.kana | ||||||
|  |     assert_equal "来ません", @kuru.long_form_present_negative.kanji | ||||||
|  |     assert_equal "きません", @kuru.long_form_present_negative.kana | ||||||
|  |     assert_equal "連れて来ません", @tsuretekuru.long_form_present_negative.kanji | ||||||
|  |     assert_equal "つれてきません", @tsuretekuru.long_form_present_negative.kana | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def test_short_form_present_positive | ||||||
|  |     assert_equal "見る", @miru.short_form_present_positive.kanji | ||||||
|  |     assert_equal "みる", @miru.short_form_present_positive.kana | ||||||
|  |     assert_equal "飲む", @nomu.short_form_present_positive.kanji | ||||||
|  |     assert_equal "のむ", @nomu.short_form_present_positive.kana | ||||||
|  |     assert_equal "する", @suru.short_form_present_positive.kanji | ||||||
|  |     assert_equal "する", @suru.short_form_present_positive.kana | ||||||
|  |     assert_equal "勉強する", @benkyousuru.short_form_present_positive.kanji | ||||||
|  |     assert_equal "べんきょうする", @benkyousuru.short_form_present_positive.kana | ||||||
|  |     assert_equal "来る", @kuru.short_form_present_positive.kanji | ||||||
|  |     assert_equal "くる", @kuru.short_form_present_positive.kana | ||||||
|  |     assert_equal "連れて来る", @tsuretekuru.short_form_present_positive.kanji | ||||||
|  |     assert_equal "つれてくる", @tsuretekuru.short_form_present_positive.kana | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def test_short_form_present_negative | ||||||
|  |     assert_equal "見ない", @miru.short_form_present_negative.kanji | ||||||
|  |     assert_equal "みない", @miru.short_form_present_negative.kana | ||||||
|  |     assert_equal "飲まない", @nomu.short_form_present_negative.kanji | ||||||
|  |     assert_equal "のまない", @nomu.short_form_present_negative.kana | ||||||
|  |     assert_equal "しない", @suru.short_form_present_negative.kanji | ||||||
|  |     assert_equal "しない", @suru.short_form_present_negative.kana | ||||||
|  |     assert_equal "勉強しない", @benkyousuru.short_form_present_negative.kanji | ||||||
|  |     assert_equal "べんきょうしない", @benkyousuru.short_form_present_negative.kana | ||||||
|  |     assert_equal "来ない", @kuru.short_form_present_negative.kanji | ||||||
|  |     assert_equal "こない", @kuru.short_form_present_negative.kana | ||||||
|  |     assert_equal "連れて来ない", @tsuretekuru.short_form_present_negative.kanji | ||||||
|  |     assert_equal "つれてこない", @tsuretekuru.short_form_present_negative.kana | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def test_long_form_past_positive | ||||||
|  |     assert_equal "見ました", @miru.long_form_past_positive.kanji | ||||||
|  |     assert_equal "みました", @miru.long_form_past_positive.kana | ||||||
|  |     assert_equal "飲みました", @nomu.long_form_past_positive.kanji | ||||||
|  |     assert_equal "のみました", @nomu.long_form_past_positive.kana | ||||||
|  |     assert_equal "しました", @suru.long_form_past_positive.kanji | ||||||
|  |     assert_equal "しました", @suru.long_form_past_positive.kana | ||||||
|  |     assert_equal "勉強しました", @benkyousuru.long_form_past_positive.kanji | ||||||
|  |     assert_equal "べんきょうしました", @benkyousuru.long_form_past_positive.kana | ||||||
|  |     assert_equal "来ました", @kuru.long_form_past_positive.kanji | ||||||
|  |     assert_equal "きました", @kuru.long_form_past_positive.kana | ||||||
|  |     assert_equal "連れて来ました", @tsuretekuru.long_form_past_positive.kanji | ||||||
|  |     assert_equal "つれてきました", @tsuretekuru.long_form_past_positive.kana | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def test_long_form_past_negative | ||||||
|  |     assert_equal "見ませんでした", @miru.long_form_past_negative.kanji | ||||||
|  |     assert_equal "みませんでした", @miru.long_form_past_negative.kana | ||||||
|  |     assert_equal "飲みませんでした", @nomu.long_form_past_negative.kanji | ||||||
|  |     assert_equal "のみませんでした", @nomu.long_form_past_negative.kana | ||||||
|  |     assert_equal "しませんでした", @suru.long_form_past_negative.kanji | ||||||
|  |     assert_equal "しませんでした", @suru.long_form_past_negative.kana | ||||||
|  |     assert_equal "勉強しませんでした", @benkyousuru.long_form_past_negative.kanji | ||||||
|  |     assert_equal "べんきょうしませんでした", @benkyousuru.long_form_past_negative.kana | ||||||
|  |     assert_equal "来ませんでした", @kuru.long_form_past_negative.kanji | ||||||
|  |     assert_equal "きませんでした", @kuru.long_form_past_negative.kana | ||||||
|  |     assert_equal "連れて来ませんでした", @tsuretekuru.long_form_past_negative.kanji | ||||||
|  |     assert_equal "つれてきませんでした", @tsuretekuru.long_form_past_negative.kana | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def test_short_form_past_positive | ||||||
|  |     assert_equal "見た", @miru.short_form_past_positive.kanji | ||||||
|  |     assert_equal "みた", @miru.short_form_past_positive.kana | ||||||
|  |     assert_equal "飲んだ", @nomu.short_form_past_positive.kanji | ||||||
|  |     assert_equal "のんだ", @nomu.short_form_past_positive.kana | ||||||
|  |     assert_equal "した", @suru.short_form_past_positive.kanji | ||||||
|  |     assert_equal "した", @suru.short_form_past_positive.kana | ||||||
|  |     assert_equal "勉強した", @benkyousuru.short_form_past_positive.kanji | ||||||
|  |     assert_equal "べんきょうした", @benkyousuru.short_form_past_positive.kana | ||||||
|  |     assert_equal "来た", @kuru.short_form_past_positive.kanji | ||||||
|  |     assert_equal "きた", @kuru.short_form_past_positive.kana | ||||||
|  |     assert_equal "連れて来た", @tsuretekuru.short_form_past_positive.kanji | ||||||
|  |     assert_equal "つれてきた", @tsuretekuru.short_form_past_positive.kana | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def test_short_form_past_negative | ||||||
|  |     assert_equal "見なかった", @miru.short_form_past_negative.kanji | ||||||
|  |     assert_equal "みなかった", @miru.short_form_past_negative.kana | ||||||
|  |     assert_equal "飲まなかった", @nomu.short_form_past_negative.kanji | ||||||
|  |     assert_equal "のまなかった", @nomu.short_form_past_negative.kana | ||||||
|  |     assert_equal "しなかった", @suru.short_form_past_negative.kanji | ||||||
|  |     assert_equal "しなかった", @suru.short_form_past_negative.kana | ||||||
|  |     assert_equal "勉強しなかった", @benkyousuru.short_form_past_negative.kanji | ||||||
|  |     assert_equal "べんきょうしなかった", @benkyousuru.short_form_past_negative.kana | ||||||
|  |     assert_equal "来なかった", @kuru.short_form_past_negative.kanji | ||||||
|  |     assert_equal "こなかった", @kuru.short_form_past_negative.kana | ||||||
|  |     assert_equal "連れて来なかった", @tsuretekuru.short_form_past_negative.kanji | ||||||
|  |     assert_equal "つれてこなかった", @tsuretekuru.short_form_past_negative.kana | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def test_desire | ||||||
|  |     assert_equal "見たい", @miru.desire.kanji | ||||||
|  |     assert_equal "みたい", @miru.desire.kana | ||||||
|  |     assert_equal "飲みたい", @nomu.desire.kanji | ||||||
|  |     assert_equal "のみたい", @nomu.desire.kana | ||||||
|  |     assert_equal "したい", @suru.desire.kanji | ||||||
|  |     assert_equal "したい", @suru.desire.kana | ||||||
|  |     assert_equal "勉強したい", @benkyousuru.desire.kanji | ||||||
|  |     assert_equal "べんきょうしたい", @benkyousuru.desire.kana | ||||||
|  |     assert_equal "来たい", @kuru.desire.kanji | ||||||
|  |     assert_equal "きたい", @kuru.desire.kana | ||||||
|  |     assert_equal "連れて来たい", @tsuretekuru.desire.kanji | ||||||
|  |     assert_equal "つれてきたい", @tsuretekuru.desire.kana | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def test_potential | ||||||
|  |     assert_equal "見られる", @miru.potential.dictionary.kanji | ||||||
|  |     assert_equal "みられる", @miru.potential.dictionary.kana | ||||||
|  |     assert_equal "飲める", @nomu.potential.dictionary.kanji | ||||||
|  |     assert_equal "のめる", @nomu.potential.dictionary.kana | ||||||
|  |     assert_equal "できる", @suru.potential.dictionary.kanji | ||||||
|  |     assert_equal "できる", @suru.potential.dictionary.kana | ||||||
|  |     assert_equal "勉強できる", @benkyousuru.potential.dictionary.kanji | ||||||
|  |     assert_equal "べんきょうできる", @benkyousuru.potential.dictionary.kana | ||||||
|  |     assert_equal "来られる", @kuru.potential.dictionary.kanji | ||||||
|  |     assert_equal "こられる", @kuru.potential.dictionary.kana | ||||||
|  |     assert_equal "連れて来られる", @tsuretekuru.potential.dictionary.kanji | ||||||
|  |     assert_equal "つれてこられる", @tsuretekuru.potential.dictionary.kana | ||||||
|  |   end | ||||||
|  | end | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user