SlideShare a Scribd company logo
1 of 46
Download to read offline
RUBY AND JAPANESE
        Makoto Inoue
     LRUG December 2010
WHO ARE WE
 (NORMAL)?
WHO ARE WE(TODAY)?
ME @ RUBYKAIGI



here




       http://image.gihyo.co.jp/assets/images/news/report/01/rubykaigi2010/0003/thumb/TH400_IMG_1253.jpg
TOPIC

Basic Japanese

Object Oriented (OO)

Functional

Japanese Programming in Ruby
BASIC JAPANESE
           Step 1
WATASHI HA RUBY GA SUKI DESU


  Kanji   Katakana   Hiragana

Kanji                    eg:    ,

Katakana                 eg:

Hiragana                eg:     , ,
Hiragana
Katakana




    Each Japanese alphabet is a combination of vowels(a,i,u,e,o) and consonants(k,s,t,n,h,m,y,r,w). Total of Hiragana and
    Katakana are 46 each. The number of possible Kanji in use in Japan is around 50,000 , though around 2000 ~ 3000 are
    in common use.
Kanji => Hiragana
 Kanji
Hiragana
Kanji     Kanji => Katakana

Katakana
WHAT’S YOUR NAME?
           How Japanese
Alphabet     interpret    Katakana Hiragana   Kanji

  Makoto makoto

  Vivian   bibiann

  Oliver   oriba-

  Max      makkusu
BUILD YOUR OWN




   http://kanji-fandom.com/
WHY SO MANY WAYS?


Kanji = To import Chinese words

Hiragana = To suit for domestic use

Katakana = To adopt new words
WHY SO MANY WAYS?


To import OO & Functional

To suit for Scripting

To adopt New Concepts
OBJECT ORIENTED

            Step 2
JAPANESE & OO




http://satoshi.blogs.com/life/2004/09/post.html
ENGLISH (SVO)



   I      like   Ruby

Subject   Verb   Object
(SOV)



Watashi ha Ruby ga Suki desu
 Subject Object   Verb

I Ruby Like
CUI(SVO)
GUI(SOV)
http://satoshi.blogs.com/life/2004/09/post.html
RUBY
# Procedural
open("box")
open("car")

# OO
Box.new.open
Car.new.open
FUNCTIONAL
        Step 3
Japanese is a politician's language



                     Makoto Inoue (Me) - 2010
POLITICIAN....

does not commit to anything unless
necessary

means different things depending on
context
PREPOSITIONS



preposition
noun Grammar
a word governing, and usually preceding, a
noun or pronoun and expressing a relation
to another word or element in the clause,
as in “the man on the platform,” “she
arrived after dinner,” “what did you do it
for you
POSTPOSITIONS



postposition
noun Grammar
a word or morpheme placed after the
word it governs, for example -ward in
homeward.
POSTPOSITIONS IN JAPANESE



   S        O
Watashi ha Ruby ga Suki desu(I Ruby Like)


       O             S
Ruby ga Watashi ha Suki desu(Ruby I Like)


       O
Ruby ga Suki desu(Ruby Like)
                Postposition is used to decide the role of noun which it supports. This enables you to
                change the order of structure very flexibly, chain as many sentence as you like, and
                also let you to omit subject.
ABUSING POSTPOSITIONS

              Don’t Read !!
  ”




      ”    Confusing, vague, and long
          sentence without much point
              (Could be powerful)
FUNCTIONAL



Lazy evaluation

high order function
RUBY


                               % 10000.times
Enumerable                     => #<Enumerator: 10000:times>


Arel User.order('users.id   DESC').limit(20).includes(:items)


Block   File.open("/tmp.txt").each do
        |line|
            puts line
        end
JAPANESE PROGRAMMING IN RUBY

RUBY
1.9
      https://github.com/makoto/japanize   Step 4
DEMO
http://screenr.com/F9L
GRAMMAR

# -*- encoding: utf-8 -*-
module Japanize
  module Grammar
    VERBS = {
      '   ' => :+,   # tasu
     '    ' => :-,   # hiku
     '     ' => :*, # kakeru
     '    ' => :/,   # waru
   }
   POSTPOSITIONAL_PARTICLES = ['     ','   ','   ','   ']
   def   ; POSTPOSITIONAL_PARTICLES; end
   def   ; NUMBERS; end
   def   ; VERBS; end
GRAMMAR

# -*- encoding: utf-8 -*-
def parse
  @sequence.split('').map do |s|
    s.split(/#{   .join("|")}/)
  end.flatten.map do |s|
    if    [s]
        [s]
    elsif     [s[0]]
      NumberConverter.convert(s)
    end
  end
end
PARSER


# -*- encoding: utf-8 -*-
describe Parser do
  it "must divide a phrase into words" do
    Parser.new("                    ").
        parse.must_equal [1, 2, :+, 4, :*]
  end
end
GOOGLE TRANSLATION
EVALUATOR



describe Evaluator do
  it "must calculate all operands" do
    Evaluator.new([1, 2, :+, 3 , :* , 1, :-, 2, :/]).
      evaluate.must_equal ((((1+2) * 3) - 1 ) / 2)
  end
end
REVERSE POLISH NOTATION




       [1, 2, :+, 3 , :* , 1, :-, 2, :/]




http://en.wikipedia.org/wiki/Reverse_Polish_notation
RubiMaVM
      RUBY VM ON RUBY




http://jp.rubyist.net/magazine/?0007-YarvManiacs
METHOD MISSING

# -*- encoding: utf-8 -*-
def method_missing (*obj)
  if    [obj[0][0]]
    parsed = Parser.new(obj[0].to_s).parse
    Evaluator.new(parsed).evaluate
  else
    super
  end
end
SO WHAT?
           :-)
WHY SO MANY WAYS?


To import OO & Functional

To suit for Scripting

To adopt New Concepts
MATZ @
         SAPPORO RUBY KAIGI
        http://regional.rubykaigi.org/sapporo03




”In future, I want Ruby to keep being the light
which brings new    concepts and ideas to people.
I also would like people to see such light, add their
own, and spread it to other people.”
                            http://igarashikuniaki.net/tdiary/20101205.html
WHAT CAN YOU DO?
                                                       http://www.igvita.com/2010/12/02/concurrency-with-actors-goroutines-ruby/




http://www.pragprog.com/titles/btlang/seven-languages-in-seven-weeks




                                                                http://www.rubyinside.com/ruby-refinements-an-overview-of-a-new-proposed-ruby-feature-3978.html
                 http://rubykaigi.org/2011/en
MERRY CHRISTMAS &
HAVE A HAPPY NEW YEAR!!
            &        !!
   hello 2011




      http://www.railsonwave.com/assets/2006/12/21/screensaver_1.jpg

More Related Content

What's hot

Ul rc_cap3_el nivel de red en internet
 Ul rc_cap3_el nivel de red en internet Ul rc_cap3_el nivel de red en internet
Ul rc_cap3_el nivel de red en internetc09271
 
Tippens fisica 7e_diapositivas_28b
Tippens fisica 7e_diapositivas_28bTippens fisica 7e_diapositivas_28b
Tippens fisica 7e_diapositivas_28bRobert
 
Electrónica digital: sistemas combinacionales multiplexores
Electrónica digital: sistemas combinacionales multiplexoresElectrónica digital: sistemas combinacionales multiplexores
Electrónica digital: sistemas combinacionales multiplexoresSANTIAGO PABLO ALBERTO
 
The Power Of Composition (DotNext 2019)
The Power Of Composition (DotNext 2019)The Power Of Composition (DotNext 2019)
The Power Of Composition (DotNext 2019)Scott Wlaschin
 
Tippens fisica 7e_diapositivas_31b
Tippens fisica 7e_diapositivas_31bTippens fisica 7e_diapositivas_31b
Tippens fisica 7e_diapositivas_31bRobert
 
Polatizacion del transistor bjt
Polatizacion del transistor bjtPolatizacion del transistor bjt
Polatizacion del transistor bjtJohan Silva Cueva
 
Solucionario circuitos eléctricos - dorf, svoboda - 6ed
Solucionario   circuitos eléctricos - dorf, svoboda - 6edSolucionario   circuitos eléctricos - dorf, svoboda - 6ed
Solucionario circuitos eléctricos - dorf, svoboda - 6edgaliap22
 
Clase 7 capacitancia y dielectricos
Clase 7 capacitancia y dielectricosClase 7 capacitancia y dielectricos
Clase 7 capacitancia y dielectricosTensor
 
Circuitos Sujetadores y Recortadores
Circuitos Sujetadores y RecortadoresCircuitos Sujetadores y Recortadores
Circuitos Sujetadores y RecortadoresJose Castro
 
2.Generador con exitación independiente.pdf
2.Generador con exitación independiente.pdf2.Generador con exitación independiente.pdf
2.Generador con exitación independiente.pdfDanielCelyCely1
 
Diapositivas capacitancia 2010
Diapositivas capacitancia 2010Diapositivas capacitancia 2010
Diapositivas capacitancia 2010jair abraham
 

What's hot (20)

Campos Electromagneticos - Tema 3
Campos Electromagneticos - Tema 3Campos Electromagneticos - Tema 3
Campos Electromagneticos - Tema 3
 
Ul rc_cap3_el nivel de red en internet
 Ul rc_cap3_el nivel de red en internet Ul rc_cap3_el nivel de red en internet
Ul rc_cap3_el nivel de red en internet
 
Magnetismo
MagnetismoMagnetismo
Magnetismo
 
Circuitos
CircuitosCircuitos
Circuitos
 
Capacitancia de difusion
Capacitancia de difusionCapacitancia de difusion
Capacitancia de difusion
 
Tippens fisica 7e_diapositivas_28b
Tippens fisica 7e_diapositivas_28bTippens fisica 7e_diapositivas_28b
Tippens fisica 7e_diapositivas_28b
 
Electrónica digital: sistemas combinacionales multiplexores
Electrónica digital: sistemas combinacionales multiplexoresElectrónica digital: sistemas combinacionales multiplexores
Electrónica digital: sistemas combinacionales multiplexores
 
Máquinas de Estado Finito en VHDL
Máquinas de Estado Finito en VHDLMáquinas de Estado Finito en VHDL
Máquinas de Estado Finito en VHDL
 
The Power Of Composition (DotNext 2019)
The Power Of Composition (DotNext 2019)The Power Of Composition (DotNext 2019)
The Power Of Composition (DotNext 2019)
 
Polarización de los Transistores
Polarización de los TransistoresPolarización de los Transistores
Polarización de los Transistores
 
Resueltos em
Resueltos emResueltos em
Resueltos em
 
Tippens fisica 7e_diapositivas_31b
Tippens fisica 7e_diapositivas_31bTippens fisica 7e_diapositivas_31b
Tippens fisica 7e_diapositivas_31b
 
Polatizacion del transistor bjt
Polatizacion del transistor bjtPolatizacion del transistor bjt
Polatizacion del transistor bjt
 
Solucionario circuitos eléctricos - dorf, svoboda - 6ed
Solucionario   circuitos eléctricos - dorf, svoboda - 6edSolucionario   circuitos eléctricos - dorf, svoboda - 6ed
Solucionario circuitos eléctricos - dorf, svoboda - 6ed
 
Clase 7 capacitancia y dielectricos
Clase 7 capacitancia y dielectricosClase 7 capacitancia y dielectricos
Clase 7 capacitancia y dielectricos
 
Circuitos Sujetadores y Recortadores
Circuitos Sujetadores y RecortadoresCircuitos Sujetadores y Recortadores
Circuitos Sujetadores y Recortadores
 
2.Generador con exitación independiente.pdf
2.Generador con exitación independiente.pdf2.Generador con exitación independiente.pdf
2.Generador con exitación independiente.pdf
 
Configuraciones con transistores BJT
Configuraciones con transistores BJTConfiguraciones con transistores BJT
Configuraciones con transistores BJT
 
Informe 2 de Electronica I laboratorio
Informe 2 de Electronica I  laboratorioInforme 2 de Electronica I  laboratorio
Informe 2 de Electronica I laboratorio
 
Diapositivas capacitancia 2010
Diapositivas capacitancia 2010Diapositivas capacitancia 2010
Diapositivas capacitancia 2010
 

Viewers also liked

Sinsai info-makoto-draft-1
Sinsai info-makoto-draft-1Sinsai info-makoto-draft-1
Sinsai info-makoto-draft-1Makoto Inoue
 
Introduction to ruby eval
Introduction to ruby evalIntroduction to ruby eval
Introduction to ruby evalNiranjan Sarade
 
Feudal Japan
Feudal JapanFeudal Japan
Feudal JapanRey Belen
 
Double consonants in Katakana
Double consonants in KatakanaDouble consonants in Katakana
Double consonants in KatakanaAccura Kurosawa
 
HS Japanese Students 's work
HS Japanese Students 's workHS Japanese Students 's work
HS Japanese Students 's workritsu shimizu
 
Japanese writing
Japanese writingJapanese writing
Japanese writingLAUSD
 
Hiragana 1 28 páginas imprimir yuko
Hiragana 1 28 páginas imprimir yukoHiragana 1 28 páginas imprimir yuko
Hiragana 1 28 páginas imprimir yukoZene Lundgren
 
How to Write Your Name in Japanese
How to Write Your Name in JapaneseHow to Write Your Name in Japanese
How to Write Your Name in JapaneseZen Sensei
 
Railsチュートリアルの歩き方 (第4版)
Railsチュートリアルの歩き方 (第4版)Railsチュートリアルの歩き方 (第4版)
Railsチュートリアルの歩き方 (第4版)Yohei Yasukawa
 

Viewers also liked (13)

Sinsai info-makoto-draft-1
Sinsai info-makoto-draft-1Sinsai info-makoto-draft-1
Sinsai info-makoto-draft-1
 
Introduction to ruby eval
Introduction to ruby evalIntroduction to ruby eval
Introduction to ruby eval
 
Feudal Japan
Feudal JapanFeudal Japan
Feudal Japan
 
Double consonants in Katakana
Double consonants in KatakanaDouble consonants in Katakana
Double consonants in Katakana
 
Katakana quiz 2
Katakana quiz 2Katakana quiz 2
Katakana quiz 2
 
HS Japanese Students 's work
HS Japanese Students 's workHS Japanese Students 's work
HS Japanese Students 's work
 
Japanese writing
Japanese writingJapanese writing
Japanese writing
 
Hiragana 1 28 páginas imprimir yuko
Hiragana 1 28 páginas imprimir yukoHiragana 1 28 páginas imprimir yuko
Hiragana 1 28 páginas imprimir yuko
 
Eng016
Eng016Eng016
Eng016
 
How to Write Your Name in Japanese
How to Write Your Name in JapaneseHow to Write Your Name in Japanese
How to Write Your Name in Japanese
 
Learning Japanese
Learning JapaneseLearning Japanese
Learning Japanese
 
Session 1 What is Japanese?
Session 1 What is Japanese?Session 1 What is Japanese?
Session 1 What is Japanese?
 
Railsチュートリアルの歩き方 (第4版)
Railsチュートリアルの歩き方 (第4版)Railsチュートリアルの歩き方 (第4版)
Railsチュートリアルの歩き方 (第4版)
 

Similar to Ruby and japanese

Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan
Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan  Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan
Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan edthix
 
Ruby for Java Developers
Ruby for Java DevelopersRuby for Java Developers
Ruby for Java DevelopersRobert Reiz
 
ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_pythontutorialsruby
 
ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_pythontutorialsruby
 
How to Begin to Develop Ruby Core
How to Begin to Develop Ruby CoreHow to Begin to Develop Ruby Core
How to Begin to Develop Ruby CoreHiroshi SHIBATA
 
Make Your Ruby Script Confusing
Make Your Ruby Script ConfusingMake Your Ruby Script Confusing
Make Your Ruby Script ConfusingSATOSHI TAGOMORI
 
Ruby -the wheel Technology
Ruby -the wheel TechnologyRuby -the wheel Technology
Ruby -the wheel Technologyppparthpatel123
 
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)Blazing Cloud
 
Ruby seen by a C# developer
Ruby seen by a C# developerRuby seen by a C# developer
Ruby seen by a C# developerEmanuele DelBono
 
Ruby seen from a C# developer
Ruby seen from a C# developerRuby seen from a C# developer
Ruby seen from a C# developerCodemotion
 
#CNX14 - Using Ruby for Reliability, Consistency, and Speed
#CNX14 - Using Ruby for Reliability, Consistency, and Speed#CNX14 - Using Ruby for Reliability, Consistency, and Speed
#CNX14 - Using Ruby for Reliability, Consistency, and SpeedSalesforce Marketing Cloud
 
Introduction to Ruby
Introduction to RubyIntroduction to Ruby
Introduction to RubyMark Menard
 
Functional programming is the most extreme programming
Functional programming is the most extreme programmingFunctional programming is the most extreme programming
Functional programming is the most extreme programmingsamthemonad
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoMatt Stine
 

Similar to Ruby and japanese (20)

Ruby
RubyRuby
Ruby
 
Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan
Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan  Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan
Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan
 
Ruby for Java Developers
Ruby for Java DevelopersRuby for Java Developers
Ruby for Java Developers
 
ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_python
 
ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_python
 
How to Begin to Develop Ruby Core
How to Begin to Develop Ruby CoreHow to Begin to Develop Ruby Core
How to Begin to Develop Ruby Core
 
roofimon@njug5
roofimon@njug5roofimon@njug5
roofimon@njug5
 
Make Your Ruby Script Confusing
Make Your Ruby Script ConfusingMake Your Ruby Script Confusing
Make Your Ruby Script Confusing
 
Ruby -the wheel Technology
Ruby -the wheel TechnologyRuby -the wheel Technology
Ruby -the wheel Technology
 
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
 
Ruby seen by a C# developer
Ruby seen by a C# developerRuby seen by a C# developer
Ruby seen by a C# developer
 
Ruby seen from a C# developer
Ruby seen from a C# developerRuby seen from a C# developer
Ruby seen from a C# developer
 
#CNX14 - Using Ruby for Reliability, Consistency, and Speed
#CNX14 - Using Ruby for Reliability, Consistency, and Speed#CNX14 - Using Ruby for Reliability, Consistency, and Speed
#CNX14 - Using Ruby for Reliability, Consistency, and Speed
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
 
Introduction to Ruby
Introduction to RubyIntroduction to Ruby
Introduction to Ruby
 
Functional programming is the most extreme programming
Functional programming is the most extreme programmingFunctional programming is the most extreme programming
Functional programming is the most extreme programming
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to Go
 
Plataforma java
Plataforma javaPlataforma java
Plataforma java
 
Make Your Own Tools
Make Your Own ToolsMake Your Own Tools
Make Your Own Tools
 
ppt7
ppt7ppt7
ppt7
 

More from Makoto Inoue

Video learningtech
Video learningtechVideo learningtech
Video learningtechMakoto Inoue
 
Benkyo player dnle2
Benkyo player dnle2Benkyo player dnle2
Benkyo player dnle2Makoto Inoue
 
Data viz as interface #ignitelondon7
Data viz as interface #ignitelondon7Data viz as interface #ignitelondon7
Data viz as interface #ignitelondon7Makoto Inoue
 
Data viz as_interface_makoto_inoue
Data viz as_interface_makoto_inoueData viz as_interface_makoto_inoue
Data viz as_interface_makoto_inoueMakoto Inoue
 
Programming 101 w_storify_api
Programming 101 w_storify_apiProgramming 101 w_storify_api
Programming 101 w_storify_apiMakoto Inoue
 
Programming 101 w_storify_api
Programming 101 w_storify_apiProgramming 101 w_storify_api
Programming 101 w_storify_apiMakoto Inoue
 
Sinsai info-rubykaigi
Sinsai info-rubykaigiSinsai info-rubykaigi
Sinsai info-rubykaigiMakoto Inoue
 
Node Js Websocket Js Meetup Slides
Node Js Websocket Js Meetup SlidesNode Js Websocket Js Meetup Slides
Node Js Websocket Js Meetup SlidesMakoto Inoue
 
Rhodes And Phone Gap
Rhodes And Phone GapRhodes And Phone Gap
Rhodes And Phone GapMakoto Inoue
 

More from Makoto Inoue (14)

Video learningtech
Video learningtechVideo learningtech
Video learningtech
 
StepUpYouTuber
StepUpYouTuberStepUpYouTuber
StepUpYouTuber
 
StepUp 4pt5
StepUp 4pt5StepUp 4pt5
StepUp 4pt5
 
Benkyo player dnle2
Benkyo player dnle2Benkyo player dnle2
Benkyo player dnle2
 
Data viz as interface #ignitelondon7
Data viz as interface #ignitelondon7Data viz as interface #ignitelondon7
Data viz as interface #ignitelondon7
 
Data viz as_interface_makoto_inoue
Data viz as_interface_makoto_inoueData viz as_interface_makoto_inoue
Data viz as_interface_makoto_inoue
 
Programming 101 w_storify_api
Programming 101 w_storify_apiProgramming 101 w_storify_api
Programming 101 w_storify_api
 
Programming 101 w_storify_api
Programming 101 w_storify_apiProgramming 101 w_storify_api
Programming 101 w_storify_api
 
Sinsai info-rubykaigi
Sinsai info-rubykaigiSinsai info-rubykaigi
Sinsai info-rubykaigi
 
Sinsai devnest
Sinsai devnestSinsai devnest
Sinsai devnest
 
euruko
eurukoeuruko
euruko
 
euruko2
euruko2euruko2
euruko2
 
Node Js Websocket Js Meetup Slides
Node Js Websocket Js Meetup SlidesNode Js Websocket Js Meetup Slides
Node Js Websocket Js Meetup Slides
 
Rhodes And Phone Gap
Rhodes And Phone GapRhodes And Phone Gap
Rhodes And Phone Gap
 

Ruby and japanese