Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
BabelZoo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PLN
BabelZoo
Commits
c36b9f70
Unverified
Commit
c36b9f70
authored
Nov 24, 2019
by
PLN (Algolia)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(parles): MVP
parent
0efd872f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
0 deletions
+36
-0
parles.py
CommentTuParles/parles.py
+36
-0
boulbi.jpg
LeBoulbiNet/boulbi.jpg
+0
-0
Lyrics_Booba.json
data/Lyrics_Booba.json
+0
-0
No files found.
CommentTuParles/parles.py
0 → 100644
View file @
c36b9f70
import
json
import
os
from
collections
import
defaultdict
def
analyse
():
path
=
"../data/"
files
=
os
.
listdir
(
path
)
stats
=
{
"avg_length"
:
defaultdict
(
lambda
:
0
),
"missing"
:
defaultdict
(
lambda
:
0
)
}
for
filename
in
files
:
with
open
(
path
+
filename
)
as
f
:
content
=
json
.
load
(
f
)
artist
=
content
[
"name"
]
songs
=
content
[
"songs"
]
print
(
"
\n
##
%
s ##"
%
artist
)
for
song
in
songs
:
title
=
song
[
"title"
]
if
song
[
"lyrics"
]
is
not
None
:
lyrics
=
song
[
"lyrics"
]
stats
[
"avg_length"
][
artist
]
+=
len
(
lyrics
)
else
:
stats
[
"missing"
][
artist
]
+=
1
stats
[
"avg_length"
][
artist
]
/=
len
(
songs
)
print
(
"
%
s: Average song is
%
i long (
%
i missing)."
%
(
artist
,
stats
[
"avg_length"
][
artist
],
stats
[
"missing"
][
artist
]))
if
__name__
==
'__main__'
:
analyse
()
LeBoulbiNet/boulbi.jpg
View replaced file @
0efd872f
View file @
c36b9f70
73.7 KB
|
W:
|
H:
85 KB
|
W:
|
H:
2-up
Swipe
Onion skin
LeBoulbiNet/
data/Lyrics_Booba.json
→
data/Lyrics_Booba.json
View file @
c36b9f70
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment