This is a first test of the composite pattern in Groovy.
It displays the different building blocks of phrases in Mandarin.
Apache Groovy is a Java-syntax-compatible object-oriented programming language for the Java platform.
It is both a static and dynamic language with features similar to those of Python, Ruby, and Smalltalk.
It can be used as both a programming language and a scripting language for the Java Platform.
Once Groovy installed, open the CLI in the directory and type this:
groovy Main.groovy
The result should be:
• Caldeira (Pò huǒ shān kǒu, 破火山口)
• Cassé (Pò, 破)
• Cratère (Huǒ shān kǒu, 火山口)
• Volcan (Huǒ shān, 火山)
• Feu (Huǒ, 火)
• Montagne (Shān, 山)
• Bouche (Kǒu, 口)