一つのお題を表す配列を直列化します。
@param (string|string[]|float)[][] $word
@return string 末尾に改行 (CRLF) を含みます。直列化できないお題だった場合は空文字列を返します。
439335
protected function serializeWord(array $word): string
    {
        if (!isset($word['type'][0]) || $word['type'][0] !== 'selection') {
            $answers = $this->getOrderedAnswers($word);
            if ($answers) {
                foreach ($answers as $answer) {
                    if (strpos($answer, '//') === false) {
                        $output = $answer;
                        break;
                    }
                }
                if (!isset($output)) {
                    $output = str_replace('/', '／', $answers[0]);
                }
                $output = strtolower($output);
                
                $comment = '';
                if (isset($word['answer'][0])) {
                    $shiftJISableText = $this->convertToShiftJISable($word['text'][0]);
                    if ($answers[0] !== $shiftJISableText && $this->isShiftJISable($shiftJISableText)) {
                        $comment .= "【${shiftJISableText}】";
                    }
                }
                if (isset($word['description'][0])) {
                    $shiftJISableDescription = $this->convertToShiftJISable($word['description'][0]['lml']);
                    if ($this->isShiftJISable($shiftJISableDescription)) {
                        $comment .= $shiftJISableDescription;
                    }
                }
                if ($comment !== '') {
                    $output .= "\t// " . str_replace("\n", ' ', $comment);
                }
                $output .= "\r\n";
            }
        }
        
        if (!isset($output)) {
            $output = '';
            $this->logUnserializableError('キャッチフィーリング', $word);
        }
        return $output;
    }
445040
private static function step0a($word)
    {
        $word = str_replace(array('ä','ö','ü'), array('A','O','U'), $word);
        $vstr = implode('', self::$vowels);
        $word = preg_replace('#(['.$vstr.'])u(['.$vstr.'])#', '$1Z$2', $word);
        $word = preg_replace('#(['.$vstr.'])y(['.$vstr.'])#', '$1Y$2', $word);

        return $word;
    }
91193
public function removeHeadword($word)
    {
        if (is_string($word)) {
            $headword = $this->getHeadwords()->word($word)->one();
            return $headword && $headword->delete() == 1;
        }
        if ($word instanceof Headword && $word->extension == $this) {
            return $word->delete() == 1;
        }
    }
137385
public function disambiguate($word)
    {
        $matches  = null;
        $contains = preg_match('/^men([aiueo])(.*)$/', $word, $matches);

        if ($contains === 1) {
            return 'n' . $matches[1] . $matches[2];
        }
    }
1104998
public static function underscore($word)
        {
            if (isset(static::$_underscored[$word])) {
                return static::$_underscored[$word];
            }

            return static::$_underscored[$word] = static::lower(static::slug($word, '_'));
        }
99921
protected function get_parts($word)
    {
        $parts = array();
        $word_l = mb_strlen($word);
        $min_l = min($this->minPart, $word_l);
        $max_l = min($this->maxPart, $word_l);
        for ($size = $min_l; $size <= $max_l; $size ++)
        {
            for ($i = 0; $i <= $word_l - $size; $i++)
            {
                $parts[] = mb_substr($word, $i, $size, "UTF-8");
            }
        }
        return $parts;
    }
50925
public function is(string $word): bool
    {
        if ($word === '') {
            return false;
        }

        $tree = &$this->tree;
        if ($tree === []) {
            return false;
        }

        $array = $this->split($word);

        foreach ($array as $char) {
            if (!isset($tree[$char])) {
                return false;
            }

            $tree = &$tree[$char];
        }

        return $tree['end'];
    }
1108105
public static function singularize(string $word): string
    {
        if (isset(static::$inflectorCache['singularize'][$word])) {
            return static::$inflectorCache['singularize'][$word];
        }

        if (!isset(static::$inflectorCache['irregular']['singular'])) {
            static::$inflectorCache['irregular']['singular'] = '(?:' . implode('|', static::$irregular) . ')';
        }

        if (preg_match('/(.*?(?:\\b|_))(' . static::$inflectorCache['irregular']['singular'] . ')$/i', $word, $regs)) {
            static::$inflectorCache['singularize'][$word] = $regs[1] . substr($regs[2], 0, 1) .
                substr(array_search(strtolower($regs[2]), static::$irregular), 1);

            return static::$inflectorCache['singularize'][$word];
        }

        if (!isset(static::$inflectorCache['uninflected'])) {
            static::$inflectorCache['uninflected'] = '(?:' . implode('|', static::$uninflected) . ')';
        }

        if (preg_match('/^(' . static::$inflectorCache['uninflected'] . ')$/i', $word, $regs)) {
            static::$inflectorCache['pluralize'][$word] = $word;

            return $word;
        }

        foreach (static::$singular as $rule => $replacement) {
            if (preg_match($rule, $word)) {
                static::$inflectorCache['singularize'][$word] = preg_replace($rule, $replacement, $word);

                return static::$inflectorCache['singularize'][$word];
            }
        }

        static::$inflectorCache['singularize'][$word] = $word;

        return $word;
    }
247822
protected static function normalize($word)
	{
		$nword = '';

		$len = strlen($word);

		for ($i = 0; $i < $len; $i++)
		{
			$o = ord( $word[$i] );

			if ($o < 97)
			{
				// convert to lowercase
				$o += 32;
			}

			if ($o > 122 || $o < 97)
			{
				// skip anything not a lowercase letter
				continue;
			}

			$nword .= chr($o);
		}

		return $nword;
	}
1315922
public function searchFile(string $word) {
		$index   = $this->addFilter(new Search($word));
		$content = $this->listFiles(true);
		$this->removeFilter($index);

		return $content;
	}
158454
protected function stemWord($word)
    {
        if ($this->isPlural($word)) {
            return $this->stemPluralWord($word);
        } else {
            return $this->stemSingularWord($word);
        }
    }
918690
public static function verbalize($word)
    {
        //Get the cached noun of it exists
        if (isset(self::$_cache['verbalized'][$word])) {
            return self::$_cache['verbalized'][$word];
        }
 
        foreach (self::$_rules['verbalization'] as $regexp => $replacement) {
            $matches = null;
            $verbal = preg_replace($regexp, $replacement, $word, -1, $matches);
            if ($matches > 0) {
                self::$_cache['verbalized'][$word] = $verbal;
                return $verbal;
            }
        }

        return $word;
    }
1033197
public function prepare_word($word)
    {
        return preg_replace(
                "[^а-яА-Яa-zA-Z]", "", str_replace(
                        array("ё", "Ё"), array("е", "е"), mb_strtolower($word, "UTF-8")
                )
        );
    }
1282599
public static function singularize(string $word): string
	{
		if (isset(static::$_cache['singularize'][$word])) {
			return static::$_cache['singularize'][$word];
		}

		if (!isset(static::$_cache['irregular']['singular'])) {
			static::$_cache['irregular']['singular'] = '(?:' . \implode('|', static::$_irregular) . ')';
		}

		if (\preg_match('/(.*?(?:\\b|_))(' . static::$_cache['irregular']['singular'] . ')$/i', $word, $regs)) {
			static::$_cache['singularize'][$word] = $regs[1] . $regs[2][0] .
				\substr(\array_search(\strtolower($regs[2]), static::$_irregular, true), 1);

			return static::$_cache['singularize'][$word];
		}

		if (!isset(static::$_cache['uninflected'])) {
			static::$_cache['uninflected'] = '(?:' . \implode('|', static::$_uninflected) . ')';
		}

		if (\preg_match('/^(' . static::$_cache['uninflected'] . ')$/i', $word, $regs)) {
			static::$_cache['pluralize'][$word] = $word;

			return $word;
		}

		foreach (static::$_singular as $rule => $replacement) {
			if (\preg_match($rule, $word)) {
				static::$_cache['singularize'][$word] = \preg_replace($rule, $replacement, $word);

				return static::$_cache['singularize'][$word];
			}
		}
		static::$_cache['singularize'][$word] = $word;

		return $word;
	}
883461
public static function singularise($word)
    {
        // Run each rule over the word
        foreach (static::$singularRules as $rule => $replacement) {
            if (preg_match($rule, $word)) {
                return preg_replace($rule, $replacement, $word);
            }
        }

        return $word;
    }
623780
public static function underscore($word)
    {
        $word = preg_replace('/([A-Z]+)([A-Z][a-z])/', '\1_\2', $word);
        $word = preg_replace('/([a-z])([A-Z])/', '\1_\2', $word);

        return str_replace('-', '_', strtolower($word));
    }
333389
private function parseSizeWord($word)
    {
        $sizeWord = strtoupper(preg_replace('/([a-z])([A-Z])/', '$1_$2', $word));
        if (array_key_exists($sizeWord, $this->sizes)) {
            $size = $this->sizes[$sizeWord];
        } else {
            $size = 0;
        }
        return $size;
    }