Package translate :: Package search :: Module match :: Class terminologymatcher

[hide private]
[frames] | no frames]

# Class terminologymatcher

source code

A matcher with settings specifically for terminology matching

Instance Methods | [hide private]

__init__(self, store, max_candidates=10, min_similarity=75, max_length=500, comparer=None) max_candidates is the maximum number of candidates that should be assembled, min_similarity is the minimum similarity that must be attained to be included in the result, comparer is an optional Comparer with similarity() function | source code

inittm(self, store) Normal initialisation, but convert all source strings to lower case | source code

getstartlength(self, min_similarity, text) Calculates the minimum length we are interested in. | source code

getstoplength(self, min_similarity, text) Calculates a length beyond which we are not interested. | source code

usable(self, unit) Returns whether this translation unit is usable for terminology. | source code

list

matches(self, text) Normal matching after converting text to lower case. | source code

Inherited from `matcher`: `buildunits`, `extendtm`, `setparameters` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables | [hide private]

| sort_reverse = `True` hash(x)

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, store, max_candidates=10, min_similarity=75, max_length=500, comparer=None)
(Constructor)

source code

max_candidates is the maximum number of candidates that should be assembled, min_similarity is the minimum similarity that must be attained to be included in the result, comparer is an optional Comparer with similarity() function

Overrides: object.__init__
  (inherited documentation)

### inittm(self, store)

source code

Normal initialisation, but convert all source strings to lower case

Overrides: matcher.inittm

### getstartlength(self, min_similarity, text)

source code

Calculates the minimum length we are interested in. The extra fat is because we don't use plain character distance only.

Overrides: matcher.getstartlength
  (inherited documentation)

### getstoplength(self, min_similarity, text)

source code

Calculates a length beyond which we are not interested. The extra fat is because we don't use plain character distance only.

Overrides: matcher.getstoplength
  (inherited documentation)

### usable(self, unit)

source code

Returns whether this translation unit is usable for terminology.

Overrides: matcher.usable

### matches(self, text)

source code

Normal matching after converting text to lower case. Then replace with the original unit to retain comments, etc.

Parameters:
  - `text` - The text that will be search for in the translation memory
Returns: list
  a list of units with the source and target strings from the translation memory. If self.addpercentage is true (default) the match quality is given as a percentage in the notes.
Overrides: matcher.matches