original_string: public function camelize($word, $firstLetter = 'upper')
      {
          if ($camelized = $this->getCache($word, 'camelize' . $firstLetter)) {
              return $camelized;
          }
  
          $camelized = $word;
          if (Horde_String::lower($camelized) != $camelized &&
              strpos($camelized, '_') !== false) {
              $camelized = str_replace('_', '/', $camelized);
          }
          if (strpos($camelized, '/') !== false) {
              $camelized = str_replace('/', '/ ', $camelized);
          }
          if (strpos($camelized, '_') !== false) {
              $camelized = strtr($camelized, '_', ' ');
          }
  
          $camelized = str_replace(' ', '', Horde_String::ucwords($camelized));
  
          if ($firstLetter == 'lower') {
              $parts = array();
              foreach (explode('/', $camelized) as $part) {
                  $part[0] = Horde_String::lower($part[0]);
                  $parts[] = $part;
              }
              $camelized = implode('/', $parts);
          }
  
          return $this->setCache($word, 'camelize' . $firstLetter, $camelized);
      }
code: public function camelize($word, $firstLetter = 'upper')
      {
          if ($camelized = $this->getCache($word, 'camelize' . $firstLetter)) {
              return $camelized;
          }
  
          $camelized = $word;
          if (Horde_String::lower($camelized) != $camelized &&
              strpos($camelized, '_') !== false) {
              $camelized = str_replace('_', '/', $camelized);
          }
          if (strpos($camelized, '/') !== false) {
              $camelized = str_replace('/', '/ ', $camelized);
          }
          if (strpos($camelized, '_') !== false) {
              $camelized = strtr($camelized, '_', ' ');
          }
  
          $camelized = str_replace(' ', '', Horde_String::ucwords($camelized));
  
          if ($firstLetter == 'lower') {
              $parts = array();
              foreach (explode('/', $camelized) as $part) {
                  $part[0] = Horde_String::lower($part[0]);
                  $parts[] = $part;
              }
              $camelized = implode('/', $parts);
          }
  
          return $this->setCache($word, 'camelize' . $firstLetter, $camelized);
      }
code_tokens: public function camelize ( $ word , $ firstLetter = 'upper' ) { if ( $ camelized = $ this -> getCache ( $ word , 'camelize' . $ firstLetter ) ) { return $ camelized ; } $ camelized = $ word ; if ( Horde_String :: lower ( $ camelized ) != $ camelized && strpos ( $ camelized , '_' ) !== false ) { $ camelized = str_replace ( '_' , '/' , $ camelized ) ; } if ( strpos ( $ camelized , '/' ) !== false ) { $ camelized = str_replace ( '/' , '/ ' , $ camelized ) ; } if ( strpos ( $ camelized , '_' ) !== false ) { $ camelized = strtr ( $ camelized , '_' , ' ' ) ; } $ camelized = str_replace ( ' ' , '' , Horde_String :: ucwords ( $ camelized ) ) ; if ( $ firstLetter == 'lower' ) { $ parts = array ( ) ; foreach ( explode ( '/' , $ camelized ) as $ part ) { $ part [ 0 ] = Horde_String :: lower ( $ part [ 0 ] ) ; $ parts [ ] = $ part ; } $ camelized = implode ( '/' , $ parts ) ; } return $ this -> setCache ( $ word , 'camelize' . $ firstLetter , $ camelized ) ; }
docstring: Camel-cases a word.
  
  @todo Do we want locale-specific or locale-independent camel casing?
  
  @param string $word         The word to camel-case.
  @param string $firstLetter  Whether to upper or lower case the first.
  letter of each slash-separated section.
  
  @return string Camelized $word
docstring_tokens: Camel - cases a word .