Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
monoids.strings_ops: rst fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mezzarobba committed Apr 11, 2015
1 parent f736624 commit 1df5afb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/sage/monoids/string_ops.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"Utility functions on strings"

#*****************************************************************************
# Copyright (C) 2007 David Kohel <kohel@maths.usyd.edu.au>
#
Expand All @@ -12,7 +14,9 @@
def strip_encoding(S):
"""
The upper case string of S stripped of all non-alphabetic characters.
EXAMPLES:
EXAMPLES::
sage: S = "The cat in the hat."
sage: strip_encoding(S)
'THECATINTHEHAT'
Expand Down Expand Up @@ -53,7 +57,9 @@ def frequency_distribution(S, n=1, field=None):
def coincidence_index(S,n=1):
"""
The coincidence index of the string S.
EXAMPLES:
EXAMPLES::
sage: S = strip_encoding("The cat in the hat.")
sage: coincidence_index(S)
0.120879120879121
Expand Down Expand Up @@ -82,7 +88,8 @@ def coincidence_discriminant(S,n=2):
Output: A measure of the difference of probability of association of
character pairs, relative to their independent one-character probabilities.
EXAMPLES:
EXAMPLES::
sage: S = strip_encoding("The cat in the hat.")
sage: coincidence_discriminant([ S[i:i+2] for i in range(len(S)-1) ])
0.0827001855677322
Expand Down

0 comments on commit 1df5afb

Please sign in to comment.