summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaohan Chen <yaohan.chen@gmail.com>2007-11-23 22:20:22 +0000
committerYaohan Chen <yaohan.chen@gmail.com>2007-11-23 22:20:22 +0000
commit0e2bcef31cc80fc0e521a3f0a2e430910bb25fe3 (patch)
treeb2e3cf120f09335daccc9bdbc3b6b09aa801aa1e
parentd1105edb72568beae81b2d15f61585fe4cb0d48d (diff)
shiritori.rb: use normalize-japanese.rb, if present, to allow katakana
-rw-r--r--data/rbot/plugins/games/shiritori.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/data/rbot/plugins/games/shiritori.rb b/data/rbot/plugins/games/shiritori.rb
index 111c914a..71016e54 100644
--- a/data/rbot/plugins/games/shiritori.rb
+++ b/data/rbot/plugins/games/shiritori.rb
@@ -15,6 +15,10 @@
# playing several games, each per channel. A game can be turn-based, where only new
# players can interrupt a turn to join, or a free mode where anyone can speak at any
# time.
+#
+# In Japanese mode, if present, the plugin can use normalize-japanese
+# <http://neruchan.mine.nu:60880/normalize-japanese.rb> to allow
+# katakana words be used like hiragana.
#
# TODO
# * a system to describe settings, so they can be displayed, changed and saved
@@ -367,7 +371,13 @@ class ShiritoriPlugin < Plugin
:listen => /\A\S+\Z/u,
:overlap_lengths => 1..4,
:desc => 'Use Japanese words in hiragana; 1-4 kana at the beginning of the next word must overlap with those at the end of the previous word.',
- # Optionally use a module to normalize Japanese words, enabling input in multiple writing systems
+ :normalize =>
+ begin
+ require 'normalize-japanese'
+ lambda {|w| w.to_hiragana}
+ rescue LoadError
+ lambda {|w| w}
+ end
}
}
end