ファイル名を取得します。
@param Dictionary $dictionary
@param string $extension ピリオドを除く拡張子。
@param string $suffix ファイル名の末尾に追加する文字列。
346203
protected function getFilename(Dictionary $dictionary, string $extension, string $suffix = '')
    {
        return $this->convertToValidFilenameWithoutExtension(
            ($dictionary->getMetadata()['@title'] ?? self::DEFAULT_FILENAME) . $suffix
        ) . ".$extension";
    }
437188
def add_suffix(fullname, suffix):
    
    name, ext = os.path.splitext(fullname)
    return name + '_' + suffix + ext
1330128
public FileFilterBuilder addExtensions(Iterable<String> extensions) {
        for (String extension : extensions) {
            // Ultimately, SuffixFileFilter will be used, and the "." needs to be explicit.
            this.extensions.add(extension.startsWith(".") ? extension : "." + extension);
        }
        return this;
    }
522579
public void updateAfterInsert(Suffix<T, S> suffix) {
        if (activeNode == root && suffix.isEmpty()) {
            activeNode = root;
            activeEdge = null;
            activeLength = 0;
        } else if (activeNode == root) {
            Object item = suffix.getStart();
            activeEdge = root.getEdgeStarting(item);
            decrementLength();
            fixActiveEdgeAfterSuffixLink(suffix);
            if (activeLength == 0)
                activeEdge = null;
        } else if (activeNode.hasSuffixLink()) {
            activeNode = activeNode.getSuffixLink();
            findTrueActiveEdge();
            fixActiveEdgeAfterSuffixLink(suffix);
            if (activeLength == 0)
                activeEdge = null;
        } else {
            activeNode = root;
            findTrueActiveEdge();
            fixActiveEdgeAfterSuffixLink(suffix);
            if (activeLength == 0)
                activeEdge = null;
        }
    }
896178
def can_handle_suffix(self, suffix):
        
        for index in self._indexes:
            if index.can_handle_suffix(suffix):
                return True

        return False
349181
public function addExtension($extension)
    {
        $extensions = $this->getExtension();
        if (is_string($extension)) {
            $extension = explode(',', $extension);
        }

        foreach ($extension as $content) {
            if (empty($content) || !is_string($content)) {
                continue;
            }

            $extensions[] = trim($content);
        }
        $extensions = array_unique($extensions);

        // Sanity check to ensure no empty values
        foreach ($extensions as $key => $ext) {
            if (empty($ext)) {
                unset($extensions[$key]);
            }
        }

        $this->_extension = implode(',', $extensions);

        return $this;
    }
1010430
protected function getFilePath(string $file, ?string $extension = null, ?string $suffix = null): string
	{
		if(strpos($file, '::') === false)
		{
			// No namespace so we'll just use the default path

			$path = $this->path;
		}
		else
		{
			// The file is namespaced so we'll use the namespace path

			[$namespace, $file] = explode('::', $file, 2);

			if(!isset($this->namespaces[$namespace]))
			{
				throw new RuntimeException(vsprintf('The [ %s ] namespace does not exist.', [$namespace]));
			}

			$path = $this->namespaces[$namespace];
		}

		// Append suffix to path if needed

		if($suffix !== null)
		{
			$path .= DIRECTORY_SEPARATOR . $suffix;
		}

		// Return full path to file

		return $path . DIRECTORY_SEPARATOR . str_replace('.', DIRECTORY_SEPARATOR, $file) . ($extension ?? $this->extension);
	}
1006201
def add_suffix(file_path, suffix):
    """"""
    split = os.path.basename(file_path).rsplit('.', 1)
    ext = split[1]
    name = split[0]
    out = str(name + '_' + suffix + '.' + ext)
    return os.path.join(os.path.dirname(file_path), out)
705801
public function definePath($id, $title, $extension, $prefix = '', $suffix = '')
    {
        $path = '';

        if ($suffix) {
            $path = sprintf(
                '%s/%s-%s%s-%s.%s',
                $this->getCurrentDirectory(),
                (new \DateTime())->format('His'),
                $prefix,
                Canonicalizer::slug($title),
                $suffix,
                $extension
            );
        } else {
            $path = sprintf(
                '%s/%s-%s%s.%s',
                $this->getCurrentDirectory(),
                (new \DateTime())->format('His'),
                $prefix,
                Canonicalizer::slug($title),
                $extension
            );
        }

        if (file_exists(sprintf('%s/%s', $this->rootDir, $path))) {
            return $this->definePath($id, $title, $extension, $prefix, intval($suffix) + 1);
        }

        return $path;
    }
1044467
public static function removeSuffix(string $value, string $suffix): string
    {
        return self::hasSuffix($value, $suffix) ? substr($value, 0, -\strlen($suffix)) : $value;
    }
1077220
public function normalize($fileName, $suffix = 0)
    {
        if ($this->casePreservation === self::LOWER_CASE) {
            $fileName = strtolower($fileName);
        }

        if ($suffix !== 0) {
            $ext = (string)pathinfo($fileName, PATHINFO_EXTENSION);
            $fn = (string)pathinfo($fileName, PATHINFO_FILENAME);
            $fileName = sprintf('%s-%d.%s', trim($fn, '.'), $suffix, $ext);
        }

        return $fileName;
    }
109023
def add_suffix(in_files, suffix):
    
    import os.path as op
    from nipype.utils.filemanip import fname_presuffix, filename_to_list
    return op.basename(fname_presuffix(filename_to_list(in_files)[0],
                                       suffix=suffix))
211806
public function replaceExtension($filename, $extension)
    {
        $parts = $this->splitFilename($filename);
        $newFilename = $parts[0] . $parts[1];
        if (is_string($extension) && ($extension !== '')) {
            $newFilename .= '.' . $extension;
        }

        return $newFilename;
    }
42043
def extend_name(suffix):
    

    def dec(cls):
        name = '{}{}'.format(cls.__name__, suffix)
        setattr(cls, '__name__', name)
        return cls

    return dec
330774
public function prependToEachKey($suffix): self
    {
        // init
        $result = [];

        foreach ($this->getGenerator() as $key => $item) {
            if ($item instanceof self) {
                $result[$key] = $item->prependToEachKey($suffix);
            } elseif (\is_array($item)) {
                $result[$key] = self::create(
                    $item,
                    $this->iteratorClass,
                    false
                )->prependToEachKey($suffix)
                    ->toArray();
            } else {
                $result[$key . $suffix] = $item;
            }
        }

        return self::create(
            $result,
            $this->iteratorClass,
            false
        );
    }
252938
public static String stripSuffixIfPresent(final String key, final String suffix) {
    if (key.endsWith(suffix)) {
      return key.substring(0, key.length() - suffix.length());
    }
    return key;
  }
1304659
public function addExtensions($extensions)
    {
        foreach ($extensions as $extName) {
            $this->twig->addExtension(is_object($extName) ? $extName : Yii::createObject($extName));
        }
    }