From 76ec3ba58c6c942abbfbac25ba71c826344ed324 Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Sat, 17 May 2014 18:40:15 -0500 Subject: [PATCH 1/2] Fix English names containing the word "the" See DFHack/dfhack#245 --- plugins/ruby/ruby.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/ruby/ruby.rb b/plugins/ruby/ruby.rb index 47924dcdf..f3504e44a 100644 --- a/plugins/ruby/ruby.rb +++ b/plugins/ruby/ruby.rb @@ -210,9 +210,17 @@ module DFHack out.last << wl.words[name.words[1]].forms[name.parts_of_speech[1]] if name.words[1] >= 0 end if name.words[5] >= 0 - out << 'the ' + out << 'the' out.last.capitalize! if out.length == 1 - (2..5).each { |i| out.last << wl.words[name.words[i]].forms[name.parts_of_speech[i]] if name.words[i] >= 0 } + out << wl.words[name.words[2]].forms[name.parts_of_speech[2]] if name.words[2] >= 0 + out << wl.words[name.words[3]].forms[name.parts_of_speech[3]] if name.words[3] >= 0 + if name.words[4] >= 0 + out << wl.words[name.words[4]].forms[name.parts_of_speech[4]] + out << '-' + else + out << '' + end + out.last << wl.words[name.words[5]].forms[name.parts_of_speech[5]] end if name.words[6] >= 0 out << 'of' From d1aee8949137ae34ea43d5771b99e267367091c8 Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Sun, 18 May 2014 13:01:07 -0500 Subject: [PATCH 2/2] remove space before hyphen --- plugins/ruby/ruby.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ruby/ruby.rb b/plugins/ruby/ruby.rb index f3504e44a..edce8ac84 100644 --- a/plugins/ruby/ruby.rb +++ b/plugins/ruby/ruby.rb @@ -216,7 +216,7 @@ module DFHack out << wl.words[name.words[3]].forms[name.parts_of_speech[3]] if name.words[3] >= 0 if name.words[4] >= 0 out << wl.words[name.words[4]].forms[name.parts_of_speech[4]] - out << '-' + out.last << '-' else out << '' end