We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 656ed8c commit 34a9f36Copy full SHA for 34a9f36
1 file changed
ietf/utils/draft.py
@@ -292,6 +292,15 @@ def get_pagecount(self):
292
self._pagecount = count_pages
293
return self._pagecount
294
295
+ # ------------------------------------------------------------------
296
+ def get_wordcount(self):
297
+ count = 0
298
+ # match any sequence of non-white-space characters like the Unix command "wc"
299
+ word_re = re.compile(r'\S+', re.UNICODE)
300
+ for l in self.lines:
301
+ count += sum(1 for _ in word_re.finditer(l))
302
+ return count
303
+
304
# ----------------------------------------------------------------------
305
def get_status(self):
306
if self._status == None:
0 commit comments