OpenQuizz
Une application de gestion des contenus pédagogiques
Collation Class Reference
Inheritance diagram for Collation:
Collaboration diagram for Collation:

Public Member Functions

def __init__ (self, locale, caseLevel=None, caseFirst=None, strength=None, numericOrdering=None, alternate=None, maxVariable=None, normalization=None, backwards=None, **kwargs)
 
def document (self)
 
def __repr__ (self)
 
def __eq__ (self, other)
 
def __ne__ (self, other)
 

Data Fields

 document
 

Detailed Description

Collation

:Parameters:
  - `locale`: (string) The locale of the collation. This should be a string
    that identifies an `ICU locale ID` exactly. For example, ``en_US`` is
    valid, but ``en_us`` and ``en-US`` are not. Consult the MongoDB
    documentation for a list of supported locales.
  - `caseLevel`: (optional) If ``True``, turn on case sensitivity if
    `strength` is 1 or 2 (case sensitivity is implied if `strength` is
    greater than 2). Defaults to ``False``.
  - `caseFirst`: (optional) Specify that either uppercase or lowercase
    characters take precedence. Must be one of the following values:

      * :data:`~CollationCaseFirst.UPPER`
      * :data:`~CollationCaseFirst.LOWER`
      * :data:`~CollationCaseFirst.OFF` (the default)

  - `strength`: (optional) Specify the comparison strength. This is also
    known as the ICU comparison level. This must be one of the following
    values:

      * :data:`~CollationStrength.PRIMARY`
      * :data:`~CollationStrength.SECONDARY`
      * :data:`~CollationStrength.TERTIARY` (the default)
      * :data:`~CollationStrength.QUATERNARY`
      * :data:`~CollationStrength.IDENTICAL`

    Each successive level builds upon the previous. For example, a
    `strength` of :data:`~CollationStrength.SECONDARY` differentiates
    characters based both on the unadorned base character and its accents.

  - `numericOrdering`: (optional) If ``True``, order numbers numerically
    instead of in collation order (defaults to ``False``).
  - `alternate`: (optional) Specify whether spaces and punctuation are
    considered base characters. This must be one of the following values:

      * :data:`~CollationAlternate.NON_IGNORABLE` (the default)
      * :data:`~CollationAlternate.SHIFTED`

  - `maxVariable`: (optional) When `alternate` is
    :data:`~CollationAlternate.SHIFTED`, this option specifies what
    characters may be ignored. This must be one of the following values:

      * :data:`~CollationMaxVariable.PUNCT` (the default)
      * :data:`~CollationMaxVariable.SPACE`

  - `normalization`: (optional) If ``True``, normalizes text into Unicode
    NFD. Defaults to ``False``.
  - `backwards`: (optional) If ``True``, accents on characters are
    considered from the back of the word to the front, as it is done in some
    French dictionary ordering traditions. Defaults to ``False``.
  - `kwargs`: (optional) Keyword arguments supplying any additional options
    to be sent with this Collation object.

.. versionadded: 3.4

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  locale,
  caseLevel = None,
  caseFirst = None,
  strength = None,
  numericOrdering = None,
  alternate = None,
  maxVariable = None,
  normalization = None,
  backwards = None,
**  kwargs 
)

Member Function Documentation

◆ __eq__()

def __eq__ (   self,
  other 
)

◆ __ne__()

def __ne__ (   self,
  other 
)

◆ __repr__()

def __repr__ (   self)

◆ document()

def document (   self)
The document representation of this collation.

.. note::
  :class:`Collation` is immutable. Mutating the value of
  :attr:`document` does not mutate this :class:`Collation`.

Field Documentation

◆ document

document

The documentation for this class was generated from the following file: