Parse the line from the synset file and turn it into a synset object
@param string $line
@return Synset
337608
public function getSynsetFromString($line)
    {
        $row = str_getcsv($line," ");  
        $synset = new Synset((int)$row[0], $row[2]);
        $synset->setDefinition(trim(substr($line, strpos($line,"|")+1)));
        
        for($index = 0; $index < (int)$row[3]; $index++)
        {                        
            $synset->addWord($row[4 + $index*2], $row[5 + $index*2]);
        }
        
        $startIdx =  5 + $row[3] * 2;
        $endIdx = ($row[$startIdx-1] * 4) + $startIdx; 
        $embeddedSynsets = array_splice($row, $startIdx, $endIdx);
        for($index = 0; $index < $row[$startIdx-1] * 4; $index+=4)
        {
            $linkedSynset = new Synset($embeddedSynsets[$index+1], $embeddedSynsets[$index+2]);
            $linkedSynset->setPtrSymbols([$embeddedSynsets[$index]]);
            
            // set src and target word indexes
            if((int)$embeddedSynsets[$index+3] === 0) {
                $linkedSynset->setSrcWordIdx(0);
                $linkedSynset->setTargetWordIdx(0);
            } else {
                $linkedSynset->setSrcWordIdx((int)($embeddedSynsets[$index+3]) % 100);
                $linkedSynset->setTargetWordIdx((int) floor($embeddedSynsets[$index+3] / 100));
            }   
            $synset->addLinkedSynset($linkedSynset);
        }              
        return $synset;        
    }
1128130
public function with($line)
    {
        if ($line instanceof Action) {
            $this->action($line->text, $line->url);
        } elseif (! $this->actionText) {
            $this->introLines[] = $this->formatLine($line);
        } else {
            $this->outroLines[] = $this->formatLine($line);
        }

        return $this;
    }
744618
protected function parseLine($line)
    {
        $split = preg_split('/\s/', $line, 2);

        return array(
            'key' => $split[0],
            'value' => isset($split[1]) ? $split[1] : null
        );
    }
540807
private function parse($line)
    {
        $uriParser = new UriParser($line);
        $line = $uriParser->encode();
        if ($uriParser->validateIP() ||
            !$uriParser->validateHost() ||
            (
                parse_url($line, PHP_URL_SCHEME) !== null &&
                !$uriParser->validateScheme()
            )
        ) {
            return false;
        }
        $parts = $this->getParts($line);
        return $parts['scheme'] . $parts['host'] . $parts['port'];
    }
1223144
protected function _decodeLine($line)
    {
        $tokens = array();
        $stack = array();

        /*
            We start to decode the response here. The unterstood tokens are:
                literal
                "literal" or also "lit\\er\"al"
                {bytes}<NL>literal
                (literals*)
            All tokens are returned in an array. Literals in braces (the last unterstood
            token in the list) are returned as an array of tokens. I.e. the following response:
                "foo" baz {3}<NL>bar ("f\\\"oo" bar)
            would be returned as:
                array('foo', 'baz', 'bar', array('f\\\"oo', 'bar'));

            // TODO: add handling of '[' and ']' to parser for easier handling of response text
        */
        //  replace any trailling <NL> including spaces with a single space
        $line = rtrim($line) . ' ';
        while (($pos = strpos($line, ' ')) !== false) {
            $token = substr($line, 0, $pos);
            while ($token[0] == '(') {
                array_push($stack, $tokens);
                $tokens = array();
                $token = substr($token, 1);
            }
            if ($token[0] == '"') {
                if (preg_match('%^\(*"((.|\\\\|\\")*?)" *%', $line, $matches)) {
                    $tokens[] = $matches[1];
                    $line = substr($line, strlen($matches[0]));
                    continue;
                }
            }
            if ($token[0] == '{') {
                $endPos = strpos($token, '}');
                $chars = substr($token, 1, $endPos - 1);
                if (is_numeric($chars)) {
                    $token = '';
                    while (strlen($token) < $chars) {
                        $token .= $this->_nextLine();
                    }
                    $line = '';
                    if (strlen($token) > $chars) {
                        $line = substr($token, $chars);
                        $token = substr($token, 0, $chars);
                    } else {
                        $line .= $this->_nextLine();
                    }
                    $tokens[] = $token;
                    $line = trim($line) . ' ';
                    continue;
                }
            }
            if ($stack && $token[strlen($token) - 1] == ')') {
                // closing braces are not seperated by spaces, so we need to count them
                $braces = strlen($token);
                $token = rtrim($token, ')');
                // only count braces if more than one
                $braces -= strlen($token) + 1;
                // only add if token had more than just closing braces
                if (rtrim($token) != '') {
                    $tokens[] = rtrim($token);
                }
                $token = $tokens;
                $tokens = array_pop($stack);
                // special handline if more than one closing brace
                while ($braces-- > 0) {
                    $tokens[] = $token;
                    $token = $tokens;
                    $tokens = array_pop($stack);
                }
            }
            $tokens[] = $token;
            $line = substr($line, $pos + 1);
        }

        // maybe the server forgot to send some closing braces
        while ($stack) {
            $child = $tokens;
            $tokens = array_pop($stack);
            $tokens[] = $child;
        }

        return $tokens;
    }
1004951
protected function parseLine( Line$line ):self
	{
		$this->currentLine= $line;
		$this->setLevel($line->getIndentLevel());

		$this->{'parse'.ucfirst($this->getLineType($line))}($line);

		return $this;
	}
1346837
protected function parseTagLine( Line$line ):self
	{
		$node= new TagNode($this,$line);

		$this->appendLine($node->open());

		$node->embed and $this->startEmbedding($node->embed);

		return $this->openNode($node);
	}
1120010
public function parseLine($line) {
        $line = trim($line, "\r\n");

        if (preg_match('/^([\w-]+):\s+(.+)/', $line, $matches)) {
            $name = strtolower($matches[1]);
            $value = $matches[2];
            $this->currentHeader = $name;

            if (isset($this->headers[$name])) {
                if (!is_array($this->headers[$name])) {
                    $this->headers[$name] = [$this->headers[$name]];
                }
                $this->headers[$name][] = $value;
            }
            else {
                $this->headers[$name] = $value;
            }
        }
        elseif (preg_match('/^\s+(.+)$/', $line, $matches) && $this->currentHeader !== null) {
            if (is_array($this->headers[$this->currentHeader])) {
                $lastKey = sizeof($this->headers[$this->currentHeader]) - 1;
                $this->headers[$this->currentHeader][$lastKey] .= $matches[1];
            }
            else {
                $this->headers[$this->currentHeader] .= $matches[1];
            }
        }

        return $this;
    }
1036389
protected function parseLine(string $line): string
    {
        if (!$this->isHiraganaCodePoints($line)) {
            throw new SyntaxException(_('ピクトセンスで使用可能の文字はひらがな、「ヴ」「ー」のみです。ただし、「ゔ」「ゕ」「ゖ」「𛀁」も使用できません: ') . $line);
        }
        
        if (mb_strlen($line, 'UTF-8') > self::WORD_MAX) {
            throw new SyntaxException(sprintf(_('「%1$s」は%2$d文字を越えています。'), $line, self::WORDS_MAX));
        }

        return str_replace('ヴ', 'ゔ', $line);
    }
1214456
public function analyseUNA(string $line)
    {
        $line = \substr($line, 0, 6);
        if (isset($line[0])) {
            $this->sepComp = \preg_quote($line[0], self::$DELIMITER);
            $this->sepUnescapedComp = $line[0];
            if (isset($line[1])) {
                $this->sepData = \preg_quote($line[1], self::$DELIMITER);
                if (isset($line[2])) {
                    $this->sepDec = $line[2]; // See later if a preg_quote is needed
                    if (isset($line[3])) {
                        $this->symbRel = \preg_quote($line[3], self::$DELIMITER);
                        $this->symbUnescapedRel = $line[3];
                        if (isset($line[4])) {
                            $this->symbRep = $line[4]; // See later if a preg_quote is needed
                            if (isset($line[5])) {
                                $this->symbEnd = \preg_quote($line[5], self::$DELIMITER);
                            }
                        }
                    }
                }
            }
            $this->unaChecked = true;
        }
    }
678954
private function parseHeaderLine($line)
    {
        $matches = [];
        if (preg_match('/^([^:]+):(.*)$/', $line, $matches) === 1) {
            $this->addHeader(trim($matches[1]), trim($matches[2]));
        }
    }
1056848
protected function parseEncoder($lines) {
    $encoders = array();
    foreach ($lines as $line) {
      if (preg_match('/^\s+([A-Z .]+)\s+(\w{2,})\s+(.*)$/', $line, $m)) {
        $type = trim($m[1]);
        if (strpos($type, 'E') !== false) {
          $encoder = trim($m[2]);
          if (strpos($encoder, ',') !== false) {
            foreach (split(',', $encoder) as $e) {
              $encoders[] = $e;
            }
          } else {
            $encoders[] = $encoder;
          }
        }
      }
    }

    sort($encoders);
    return $encoders;
  }
991054
protected function parseLine($line)
    {
        if (preg_match(self::TEST_DIAGNOSTIC, $line) || preg_match(self::TEST_COVERAGE, $line) || !$line) {
            return;
        }

        if (preg_match(self::TEST_COUNTS_PATTERN, $line, $matches)) {
            $this->testCount = intval($matches[1]);

            return;
        }

        if ($this->testDepends($line)) {
            return;
        }

        if ($this->testLine($line)) {
            return;
        }

        if ($this->yamlLine($line)) {
            return;
        }

        throw new Exception(sprintf('Incorrect TAP data, line %d: %s', $this->lineNumber, $line));
    }
655048
public function parseLine( Line$line ):parent
	{
		$content= '<code>'.htmlentities($line->fullContent).'</code>';

		$indentation= $this->document->indentation;

		false!==$indentation and $content= str_repeat($indentation,$this->document->indentLevel).$content."\n";

		$this->content.= $content;

		return $this;
	}
31224
def parse(self, line):
        
        tree = list(self.parser.raw_parse(line))[0]
        tree = tree[0]
        return tree
597723
public function parseTableSeparatorLine(string $line) : ?TableSeparatorLineConfig
    {
        $header = false;
        $pretty = false;
        $line   = trim($line);

        if ($line === '') {
            return null;
        }

        // Finds the table chars
        $chars = $this->findTableChars($line);

        if ($chars === null) {
            return null;
        }

        if ($chars[0] === self::PRETTY_TABLE_JOINT && $chars[1] === self::PRETTY_TABLE_LETTER) {
            $pretty = true;
            // reverse the chars: - is the line char, + is the space char
            $chars = [self::PRETTY_TABLE_LETTER, self::PRETTY_TABLE_JOINT];
        } elseif ($chars[0] === self::PRETTY_TABLE_JOINT && $chars[1] === self::PRETTY_TABLE_HEADER) {
            $pretty = true;
            $header = true;
            // reverse the chars: = is the line char, + is the space char
            $chars = [self::PRETTY_TABLE_HEADER, self::PRETTY_TABLE_JOINT];
        } else {
            // either a simple table or not a separator line

            // if line char is not "=" or "-", not a separator line
            if (! in_array($chars[0], [self::SIMPLE_TABLE_LETTER, self::SIMPLE_TABLE_LETTER_ALT], true)) {
                return null;
            }

            // if space char is not a space, not a separator line
            if ($chars[1] !== ' ') {
                return null;
            }
        }

        $parts = [];
        /** @var int|null $currentPartStart */
        $currentPartStart = null;

        $i = 0;
        for ($i = 0; $i < strlen($line); $i++) {
            // we found the "line char": "-" or "="
            if ($line[$i] === $chars[0]) {
                if ($currentPartStart === null) {
                    $currentPartStart = $i;
                }

                continue;
            }

            if ($line[$i] !== $chars[1]) {
                throw new Exception(sprintf('Unexpected char "%s"', $line[$i]));
            }

            // found the "space" char
            // record the part "range" if we're at the end of a range
            if ($currentPartStart === null) {
                continue;
            }

            $parts[]          = [$currentPartStart, $i];
            $currentPartStart = null;
        }

        // finish the last "part"
        if ($currentPartStart !== null) {
            $parts[] = [$currentPartStart, $i];
        }

        if (count($parts) > 1) {
            return new TableSeparatorLineConfig(
                $header,
                $pretty ? TableNode::TYPE_PRETTY : TableNode::TYPE_SIMPLE,
                $parts,
                $chars[0],
                $line
            );
        }

        return null;
    }
1201366
public function parseLine($line) {

        $data = explode(";", $line);
        $i    = -1;

        $model = new StartRecordFormat();
        $model->setVersionRecordStructure(IntegerHelper::parseString($data[++$i]));
        $model->setFacilityNumber(IntegerHelper::parseString($data[++$i]));
        $model->setDateFile($this->decodeDate($data[++$i]));
        $model->setNumberRecords(IntegerHelper::parseString($data[++$i]));
        $model->setCurrency($this->decodeString($data[++$i]));

        return $model;
    }