original_string: public function choose($line, $number, $locale)
      {
          $segments = explode('|', $line);
  
          if (($value = $this->extract($segments, $number)) !== null) {
              return trim($value);
          }
  
          $segments = $this->stripConditions($segments);
  
          $pluralIndex = $this->getPluralIndex($locale, $number);
  
          if (count($segments) === 1 || ! isset($segments[$pluralIndex])) {
              return $segments[0];
          }
  
          return $segments[$pluralIndex];
      }
code: public function choose($line, $number, $locale)
      {
          $segments = explode('|', $line);
  
          if (($value = $this->extract($segments, $number)) !== null) {
              return trim($value);
          }
  
          $segments = $this->stripConditions($segments);
  
          $pluralIndex = $this->getPluralIndex($locale, $number);
  
          if (count($segments) === 1 || ! isset($segments[$pluralIndex])) {
              return $segments[0];
          }
  
          return $segments[$pluralIndex];
      }
code_tokens: public function choose ( $ line , $ number , $ locale ) { $ segments = explode ( '|' , $ line ) ; if ( ( $ value = $ this -> extract ( $ segments , $ number ) ) !== null ) { return trim ( $ value ) ; } $ segments = $ this -> stripConditions ( $ segments ) ; $ pluralIndex = $ this -> getPluralIndex ( $ locale , $ number ) ; if ( count ( $ segments ) === 1 || ! isset ( $ segments [ $ pluralIndex ] ) ) { return $ segments [ 0 ] ; } return $ segments [ $ pluralIndex ] ; }
docstring: Select a proper translation string based on the given number.
  
  @param  string  $line
  @param  int  $number
  @param  string  $locale
  @return mixed
docstring_tokens: Select a proper translation string based on the given number .