Created
November 14, 2009 09:56
-
-
Save yuroyoro/234465 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.xml._ | |
import scala.io.Source | |
object Chu2Name{ | |
def main( args:Array[String] ){ | |
val url = "http://pha22.net/name2/c/%s".format( args.first ) | |
val r ="""「(.+)((.+))」""".r | |
Source.fromURL( url, "utf-8").getLines.foreach{ | |
s => r.findFirstMatchIn(s). | |
map{ _.subgroups}. | |
map{ case List(n, m) => println( m + ":" + n ) } | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment