X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=src%2Fpyutils%2Fstring_utils.py;h=69ab83707211a76ee2a9b32a54af20a5a61d8443;hb=eb7d4fcb7edb2f6d405cbfbba6bb2df484af4d94;hp=575e64e7ff8fbd151a936201385c05fc5b61555a;hpb=84f53cd94d18a8d239216704a6a33c7dbf2fc6b9;p=pyutils.git diff --git a/src/pyutils/string_utils.py b/src/pyutils/string_utils.py index 575e64e..69ab837 100644 --- a/src/pyutils/string_utils.py +++ b/src/pyutils/string_utils.py @@ -4,6 +4,7 @@ """The MIT License (MIT) Copyright (c) 2016-2020 Davide Zanotti + Modifications Copyright (c) 2021-2022 Scott Gasch Permission is hereby granted, free of charge, to any person obtaining a copy @@ -1680,7 +1681,7 @@ def sprintf(*args, **kwargs) -> str: Returns: An interpolated string capturing print output, like man(3) - :code:sprintf. + `sprintf`. """ ret = "" @@ -2033,7 +2034,11 @@ def ngrams_presplit(words: Sequence[str], n: int): def bigrams(txt: str): - """Generates the bigrams (n=2) of the given string.""" + """Generates the bigrams (n=2) of the given string. + + >>> [x for x in bigrams('this is a test')] + ['this is', 'is a', 'a test'] + """ return ngrams(txt, 2)