module PNames

  URL="http://www.baduk.or.kr/commonpop/profile.asp?gno="
  @@names= []

  def PNames.init(file)
    n=nil
    f= File.new(file)

    while not f.eof?
      num = f.readline.to_i
      n= f.readline.chomp.split(':')
      n[0]= num
      @@names.push(n)

      f.readline
      f.readline
      f.readline

    end

  end

  def PNames.to_english(name)
    find= nil
    id=nil
    @@names.each {|arr| if arr.include?(name)
      find= arr[3]
      id= arr[0]
      break
  end
    }
    return [find,id]
  end

  def PNames.open_url(nb)
    url=URL+nb.to_s
    Defaults.open_url(url)

  end

end
