<commit_before><?php

/*
 * This file is part of the Tadcka package.
 *
 * (c) Tadcka <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Tadcka\Component\Mapper\Provider;

use Tadcka\Component\Mapper\Exception\ResourceNotFoundException;
use Tadcka\Component\Mapper\MapperItemInterface;
use Tadcka\Component\Mapper\Model\CategoryInterface;
use Tadcka\Component\Mapper\Model\Manager\MappingManagerInterface;
use Tadcka\Component\Mapper\Model\SourceInterface;

/**
 * @author <NAME> <<EMAIL>>
 *
 * @since 7/13/14 4:24 PM
 */
interface MapperProviderInterface
{
    /**
     * Get mapper source.
     *
     * @param string $name
     *
     * @return null|SourceInterface
     */
    public function getSource($name);

    /**
     * Get mapper.
     *
     * @param SourceInterface $source
     * @param string $locale
     *
     * @return MapperItemInterface
     *
     * @throws ResourceNotFoundException
     */
    public function getMapper(SourceInterface $source, $locale);

    /**
     * Get mapping categories.
     *
     * @param CategoryInterface $category
     * @param SourceInterface $source
     *
     * @return array|CategoryInterface[]
     */
    public function getMappingCategories(CategoryInterface $category, SourceInterface $source);

    /**
     * Can use for mapping.
     *
     * @param string $categorySlug
     * @param MapperItemInterface $mapperItem
     *
     * @return bool
     */
    public function canUseForMapping($categorySlug, MapperItemInterface $mapperItem);

    /**
     * Get mapper items.
     *
     * @param array|CategoryInterface[] $categories
     * @param MapperItemInterface $mapperItem
     *
     * @return array|MappingManagerInterface[]
     */
    public function getMapperItems(array $categories, MapperItemInterface $mapperItem);

    /**
     * Get mapper item by category.
     *
     * @param string $categorySlug
     * @param MapperItemInterface $mapperItem
     *
     * @return null|MapperItemInterface
     */
    public function getMapperItemByCategory($categorySlug, MapperItemInterface $mapperItem);
}<commit_msg>Change mapper provider interface.<commit_after><?php

/*
 * This file is part of the Tadcka package.
 *
 * (c) Tadcka <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Tadcka\Component\Mapper\Provider;

use Tadcka\Component\Mapper\Exception\ResourceNotFoundException;
use Tadcka\Component\Mapper\MapperItemInterface;
use Tadcka\Component\Mapper\Model\CategoryInterface;
use Tadcka\Component\Mapper\Model\Manager\MappingManagerInterface;
use Tadcka\Component\Mapper\Model\SourceInterface;

/**
 * @author <NAME> <<EMAIL>>
 *
 * @since 7/13/14 4:24 PM
 */
interface MapperProviderInterface
{
    /**
     * Get mapper source.
     *
     * @param string $name
     *
     * @return null|SourceInterface
     */
    public function getSource($name);

    /**
     * Get mapper.
     *
     * @param SourceInterface $source
     * @param string $locale
     *
     * @return MapperItemInterface
     *
     * @throws ResourceNotFoundException
     */
    public function getMapper(SourceInterface $source, $locale);

    /**
     * Get mapping categories.
     *
     * @param CategoryInterface $category
     * @param SourceInterface $source
     *
     * @return array|CategoryInterface[]
     */
    public function getMappingCategories(CategoryInterface $category, SourceInterface $source);

    /**
     * Get mapper items.
     *
     * @param array|CategoryInterface[] $categories
     * @param MapperItemInterface $mapperItem
     *
     * @return array|MappingManagerInterface[]
     */
    public function getMapperItems(array $categories, MapperItemInterface $mapperItem);

    /**
     * Get mapper item by category.
     *
     * @param string $categorySlug
     * @param MapperItemInterface $mapperItem
     *
     * @return null|MapperItemInterface
     */
    public function getMapperItemByCategory($categorySlug, MapperItemInterface $mapperItem);
}
{'fraction_non_alphanumeric': 0.10096153846153846, 'fraction_numerical': 0.0038461538461538464, 'mean_word_length': 3.0754162585700295, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4874361', 'n_tokens_mistral': 1189, 'n_tokens_neox': 1168, 'n_words': 284}