| |
Methods defined here:
- __getitem__(self, s)
- Return count of word s. '.' is the wildcard, "^" excepted.
(x.__getitem__(s) <==> x[s]).
- __iadd__(self, c)
- Add counts of Compte c (x.__iadd__(c) <==> x+=c).
- __str__(self)
- (x.__str__()<==> str(x))
- add_pseudo(self, x, val=1)
- Add the counts of the word x with optionnal value val=1.
Only the count of the given word are added, and not its prefixes.
- add_seq(self, s, lg, **kw)
- Add the counts of words at most lg-length from sequence s.
Needs operator s[].
Character '^' is for beginnings and ends of sequences.
Keyword argument:
deb -- Count only after position deb (>=0) included;
fin -- Count only before position fin (<len()) included;
alpha -- Count only words which letters are in string alpha. If
alpha='', do not consider alpha;
fact -- Count each word fact (default: 1).
- copy(self)
- Return a copy of this Compte
- has_prefix(self, s)
- Return True iff s is a STRICT prefix (^ excluded), else False.
- intersects(self, a)
- Return the Compte of the counts of self restricted to the
words of a.
- max(self, a)
- Return the Compte of the maximum between a and self.
- min(self, a)
- Return the Compte of the minimum between a and self.
- next(self, s)
- Return the list of [letter, value] which s in the prefix.
- pref(self, l)
- Return the string of counts of l-length words.
- prop(self, **kw)
- Return the corresponding Proportion:
Keyword argument:
lpost -- length of the posterior words (ie on the right) (default: max);
lprior -- length of the prior words (ie on the left) (default: 0).
- restrict_to(self, alph)
- Return the Compte restricted to letters of string alph.
Keep the ends ^.
- rstrip(self, d=1)
- Return the Compte without ending characters ^.
- strip(self, d=1)
- Return the Compte without characters ^.
- words(self, s='')
- Return the list of the words.
Methods inherited from _Arbre:
- __idiv__(self, v)
- Divide each node by value v (x.__idiv(v) <==> x/= v).
- __init__(self, **kw)
- Keyword argument:
fic -- Build from filename f.
- alph(self, t=[])
- Return the list of the letters.
- is_empty(self)
- Return True if dictionary is empty.
- lg_max(self)
- Return the length of the longest word.
- read_nf(self, nf)
- Build from filename nf.
|