Class: String
Instance Method Summary collapse
-
#nt_escape ⇒ Object
returns string after.
-
#unCamelCase ⇒ Object
insert space between camelcase Example: unCamelCase(“abcDef”) returns “abc Def”.
Instance Method Details
#nt_escape ⇒ Object
returns string after
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/ontomde-uml2-kb/protege.rb', line 43 def nt_escape #TODO: gestion generique de l'unicode return self.to_s. gsub(/\\n/,'<br>'). gsub(/\\u0085/,''). # next line ??? gsub(/\\u00EE/,'i'). # i acute gsub(/\\u00F4/,'o'). # o circ gsub(/\\u00E7/,'c'). # c cedil gsub(/\\u00E0/,'a'). # a grav gsub(/\\u00E8/,'e'). # e grav gsub(/\\u00E9/,'e'). # e acute gsub(/\\u00C9/,'E'). # E acute gsub(/\\u00EA/,'e'). # e circ tr("^\#*a-zA-Z0-9 ,.!?:_\'\/<>-",'_'). gsub(/<br>/,'\\n') end |
#unCamelCase ⇒ Object
insert space between camelcase Example: unCamelCase(“abcDef”) returns “abc Def”
38 39 40 |
# File 'lib/ontomde-uml2-kb/protege.rb', line 38 def unCamelCase return gsub(/([a-z])([A-Z])/,'\1 \2') end |