original_string: protected static function _removeLastWord($text)
      {
          $spacepos = mb_strrpos($text, ' ');
  
          if ($spacepos !== false) {
              $lastWord = mb_strrpos($text, $spacepos);
  
              // Some languages are written without word separation.
              // We recognize a string as a word if it doesn't contain any full-width characters.
              if (mb_strwidth($lastWord) === mb_strlen($lastWord)) {
                  $text = mb_substr($text, 0, $spacepos);
              }
  
              return $text;
          }
  
          return '';
      }
code: protected static function _removeLastWord($text)
      {
          $spacepos = mb_strrpos($text, ' ');
  
          if ($spacepos !== false) {
              $lastWord = mb_strrpos($text, $spacepos);
  
              // Some languages are written without word separation.
              // We recognize a string as a word if it doesn't contain any full-width characters.
              if (mb_strwidth($lastWord) === mb_strlen($lastWord)) {
                  $text = mb_substr($text, 0, $spacepos);
              }
  
              return $text;
          }
  
          return '';
      }
code_tokens: protected static function _removeLastWord ( $ text ) { $ spacepos = mb_strrpos ( $ text , ' ' ) ; if ( $ spacepos !== false ) { $ lastWord = mb_strrpos ( $ text , $ spacepos ) ; // Some languages are written without word separation. // We recognize a string as a word if it doesn't contain any full-width characters. if ( mb_strwidth ( $ lastWord ) === mb_strlen ( $ lastWord ) ) { $ text = mb_substr ( $ text , 0 , $ spacepos ) ; } return $ text ; } return '' ; }
docstring: Removes the last word from the input text.
  
  @param string $text The input text
  @return string
docstring_tokens: Removes the last word from the input text .