Flowdock
method

parse_codepoints

Importance_0
Ruby on Rails latest stable (v4.1.8) - 0 notes - Class: DatabaseGenerator
parse_codepoints(line) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activesupport/bin/generate_tables, line 33
        def parse_codepoints(line)
          codepoint = Codepoint.new
          raise "Could not parse input." unless line =~ /^
            ([0-9A-F]+);        # code
            ([^;]+);            # name
            ([A-Z]+);           # general category
            ([0-9]+);           # canonical combining class
            ([A-Z]+);           # bidi class
            (<([A-Z]*)>)?       # decomposition type
            ((\ ?[0-9A-F]+)*);  # decomposition mapping
            ([0-9]*);           # decimal digit
            ([0-9]*);           # digit
            ([^;]*);            # numeric
            ([YN]*);            # bidi mirrored
            ([^;]*);            # unicode 1.0 name
            ([^;]*);            # iso comment
            ([0-9A-F]*);        # simple uppercase mapping
            ([0-9A-F]*);        # simple lowercase mapping
            ([0-9A-F]*)$/x     # simple titlecase mapping
          codepoint.code              = $1.hex
          #codepoint.name              = $2
          #codepoint.category          = $3
          codepoint.combining_class   = Integer($4)
          #codepoint.bidi_class        = $5
          codepoint.decomp_type       = $7
          codepoint.decomp_mapping    = ($8=='') ? nil : $8.split.collect { |element| element.hex }
          #codepoint.bidi_mirrored     = ($13=='Y') ? true : false
          codepoint.uppercase_mapping = ($16=='') ? 0 : $16.hex
          codepoint.lowercase_mapping = ($17=='') ? 0 : $17.hex
          #codepoint.titlecase_mapping = ($18=='') ? nil : $18.hex
          @ucd.codepoints[codepoint.code] = codepoint
        end
Register or log in to add new notes.