Python typing.Counter() Examples
The following are 30
code examples of typing.Counter().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
typing
, or try the search function
.
Example #1
Source File: node_summary.py From pybel with MIT License | 5 votes |
def get_top_hubs(graph: BELGraph, *, n: Optional[int] = 15) -> List[Tuple[BaseEntity, int]]: """Get the top hubs in the graph by BEL. :param graph: A BEL graph :param n: The number of top hubs to return. If None, returns all nodes """ return Counter(dict(graph.degree())).most_common(n=n)
Example #2
Source File: errors.py From pybel with MIT License | 5 votes |
def count_error_types(graph: BELGraph) -> typing.Counter[str]: """Count the occurrence of each type of error in a graph. :return: A Counter of {error type: frequency} """ return Counter( exc.__class__.__name__ for _, exc, _ in graph.warnings )
Example #3
Source File: errors.py From pybel with MIT License | 5 votes |
def count_naked_names(graph: BELGraph) -> typing.Counter[str]: """Count the frequency of each naked name (names without namespaces). :return: A Counter from {name: frequency} """ return Counter(_naked_names_iter(graph))
Example #4
Source File: _ngram_corpus.py From abydos with GNU General Public License v3.0 | 5 votes |
def __init__(self, corpus: Optional[Corpus] = None) -> None: r"""Initialize Corpus. Parameters ---------- corpus : Corpus The :py:class:`Corpus` from which to initialize the n-gram corpus. By default, this is None, which initializes an empty NGramCorpus. This can then be populated using NGramCorpus methods. Raises ------ TypeError Corpus argument must be None or of type abydos.Corpus Example ------- >>> tqbf = 'The quick brown fox jumped over the lazy dog.\n' >>> tqbf += 'And then it slept.\n And the dog ran off.' >>> ngcorp = NGramCorpus(Corpus(tqbf)) .. versionadded:: 0.3.0 """ self.ngcorpus = Counter() # type: TCounter[Optional[str]] if corpus is None: return elif isinstance(corpus, Corpus): self.corpus_importer(corpus) else: raise TypeError( 'Corpus argument must be None or of type abydos.corpus.Corpus. ' + str(type(corpus)) + ' found.' )
Example #5
Source File: _gilbert_wells.py From abydos with GNU General Public License v3.0 | 5 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, **kwargs: Any ) -> None: """Initialize GilbertWells instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. .. versionadded:: 0.4.0 """ super(GilbertWells, self).__init__( alphabet=alphabet, tokenizer=tokenizer, **kwargs )
Example #6
Source File: _maxwell_pilliner.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize MaxwellPilliner instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(MaxwellPilliner, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #7
Source File: _upholt.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize Upholt instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(Upholt, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #8
Source File: _hurlbert.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize Hurlbert instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(Hurlbert, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #9
Source File: _yule_q.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize YuleQ instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(YuleQ, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #10
Source File: _warrens_iv.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize WarrensIV instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(WarrensIV, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #11
Source File: _kuhns_i.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize KuhnsI instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(KuhnsI, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #12
Source File: _baulieu_iv.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', positive_irrational: float = e, **kwargs: Any ) -> None: """Initialize BaulieuIV instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(BaulieuIV, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs ) self._positive_irrational = positive_irrational
Example #13
Source File: _unknown_l.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize UnknownL instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(UnknownL, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #14
Source File: _size.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize Size instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(Size, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #15
Source File: _yule_y.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize YuleY instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(YuleY, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #16
Source File: _shape.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize Shape instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(Shape, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #17
Source File: _kuhns_iii.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize KuhnsIII instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(KuhnsIII, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #18
Source File: _sokal_sneath_iv.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize SokalSneathIV instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(SokalSneathIV, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #19
Source File: _unknown_d.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize UnknownD instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(UnknownD, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #20
Source File: _braun_blanquet.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize BraunBlanquet instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(BraunBlanquet, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #21
Source File: _consonni_todeschini_iv.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize ConsonniTodeschiniIV instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(ConsonniTodeschiniIV, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #22
Source File: _baulieu_xiv.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize BaulieuXIV instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(BaulieuXIV, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #23
Source File: _maarel.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize Maarel instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(Maarel, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #24
Source File: _jaccard_nm.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize JaccardNM instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(JaccardNM, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #25
Source File: _kuhns_ix.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize KuhnsIX instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(KuhnsIX, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #26
Source File: _mcconnaughey.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize McConnaughey instance. Parameters ---------- tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(McConnaughey, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #27
Source File: _kuhns_vi.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize KuhnsVI instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(KuhnsVI, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #28
Source File: _koppen_ii.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize KoppenII instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(KoppenII, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #29
Source File: _baulieu_xi.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize BaulieuXI instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(BaulieuXI, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )
Example #30
Source File: _unknown_h.py From abydos with GNU General Public License v3.0 | 4 votes |
def __init__( self, alphabet: Optional[ Union[TCounter[str], Sequence[str], Set[str], int] ] = None, tokenizer: Optional[_Tokenizer] = None, intersection_type: str = 'crisp', **kwargs: Any ) -> None: """Initialize UnknownH instance. Parameters ---------- alphabet : Counter, collection, int, or None This represents the alphabet of possible tokens. See :ref:`alphabet <alphabet>` description in :py:class:`_TokenDistance` for details. tokenizer : _Tokenizer A tokenizer instance from the :py:mod:`abydos.tokenizer` package intersection_type : str Specifies the intersection type, and set type as a result: See :ref:`intersection_type <intersection_type>` description in :py:class:`_TokenDistance` for details. **kwargs Arbitrary keyword arguments Other Parameters ---------------- qval : int The length of each q-gram. Using this parameter and tokenizer=None will cause the instance to use the QGram tokenizer with this q value. metric : _Distance A string distance measure class for use in the ``soft`` and ``fuzzy`` variants. threshold : float A threshold value, similarities above which are counted as members of the intersection for the ``fuzzy`` variant. .. versionadded:: 0.4.0 """ super(UnknownH, self).__init__( alphabet=alphabet, tokenizer=tokenizer, intersection_type=intersection_type, **kwargs )