Class: String
- Defined in:
- lib/ontomde-uml2/kb/protege.rb,
lib/ontomde-uml2/autoImplement.rb
Instance Method Summary collapse
-
#nt_escape ⇒ Object
returns string after.
- #str_to_uri ⇒ Object
-
#unCamelCase ⇒ Object
insert space between camelcase Example: unCamelCase(“abcDef”) returns “abc Def”.
Instance Method Details
#nt_escape ⇒ Object
returns string after
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/ontomde-uml2/kb/protege.rb', line 47 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 |
#str_to_uri ⇒ Object
15 16 17 |
# File 'lib/ontomde-uml2/autoImplement.rb', line 15 def str_to_uri return self.tr(" <>:/","_") end |
#unCamelCase ⇒ Object
insert space between camelcase Example: unCamelCase(“abcDef”) returns “abc Def”
42 43 44 |
# File 'lib/ontomde-uml2/kb/protege.rb', line 42 def unCamelCase return gsub(/([a-z])([A-Z])/,'\1 \2') end |