Skip to content

Commit

Permalink
feat(#149): avg_wlen
Browse files Browse the repository at this point in the history
  • Loading branch information
h1alexbel committed Oct 21, 2024
1 parent 3f2d1e0 commit 046445c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sr-data/src/sr_data/steps/lens.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,9 @@ def avg_slen(readme):


def avg_wlen(readme):
return 0
words = re.findall(r'\w+', readme)
total = sum(len(word) for word in words)
result = 0
if words:
result = total / len(words)
return result

0 comments on commit 046445c

Please sign in to comment.