Skip to content

Commit

Permalink
Updates from freecodecamp video
Browse files Browse the repository at this point in the history
  • Loading branch information
kying18 committed Nov 29, 2020
1 parent 7ad03fe commit 3d844c6
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 4 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
# graph-composer
Using graphs to represent relationships between words in song lyrics and then generating new lyrics.. *ahem* interpretive poetry... from the graph
# Markov Chain Composer
Using Markov Chain to represent relationships between words in song lyrics and then generating new lyrics.. *ahem* interpretive poetry... from the graph

To run: `python3 compose.py`

You'll have to slightly change some of the code in order to adjust length of composition/which file is the vocabulary for the composition.

YouTube Kylie Ying: https://www.youtube.com/ycubed
Twitch KylieYing: https://www.twitch.tv/kylieying
Twitter @kylieyying: https://twitter.com/kylieyying
Instagram @kylieyying: https://www.instagram.com/kylieyying/
Website: https://www.kylieying.com
Github: https://www.github.com/kying18
Programmer Beast Mode Spotify playlist: https://open.spotify.com/playlist/4Akns5EUb3gzmlXIdsJkPs?si=qGc4ubKRRYmPHAJAIrCxVQ
15 changes: 13 additions & 2 deletions compose.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
"""
Implemented Markov Chain Composer by Kylie Ying
YouTube Kylie Ying: https://www.youtube.com/ycubed
Twitch KylieYing: https://www.twitch.tv/kylieying
Twitter @kylieyying: https://twitter.com/kylieyying
Instagram @kylieyying: https://www.instagram.com/kylieyying/
Website: https://www.kylieying.com
Github: https://www.github.com/kying18
Programmer Beast Mode Spotify playlist: https://open.spotify.com/playlist/4Akns5EUb3gzmlXIdsJkPs?si=qGc4ubKRRYmPHAJAIrCxVQ
"""

import os
import re
from graph import Graph, Vertex
import string
import random

from graph import Graph, Vertex

def get_words_from_text(text_path):
with open(text_path, 'rb') as file:
Expand Down
34 changes: 34 additions & 0 deletions compose_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""
Empty Compose Template to implement :D
YouTube Kylie Ying: https://www.youtube.com/ycubed
Twitch KylieYing: https://www.twitch.tv/kylieying
Twitter @kylieyying: https://twitter.com/kylieyying
Instagram @kylieyying: https://www.instagram.com/kylieyying/
Website: https://www.kylieying.com
Github: https://www.github.com/kying18
Programmer Beast Mode Spotify playlist: https://open.spotify.com/playlist/4Akns5EUb3gzmlXIdsJkPs?si=qGc4ubKRRYmPHAJAIrCxVQ
"""

import os
import re
import string
import random

from graph import Graph, Vertex

def get_words_from_text(text_path):
pass

def make_graph(words):
pass

def compose(g, words, length=50):
pass

def main():
pass


if __name__ == '__main__':
main()
12 changes: 12 additions & 0 deletions graph.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
"""
Implemented Markov Chain Composer Graph object by Kylie Ying
YouTube Kylie Ying: https://www.youtube.com/ycubed
Twitch KylieYing: https://www.twitch.tv/kylieying
Twitter @kylieyying: https://twitter.com/kylieyying
Instagram @kylieyying: https://www.instagram.com/kylieyying/
Website: https://www.kylieying.com
Github: https://www.github.com/kying18
Programmer Beast Mode Spotify playlist: https://open.spotify.com/playlist/4Akns5EUb3gzmlXIdsJkPs?si=qGc4ubKRRYmPHAJAIrCxVQ
"""

import random

class Vertex(object):
Expand Down
55 changes: 55 additions & 0 deletions graph_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

"""
Empty Graph Template to implement :D
YouTube Kylie Ying: https://www.youtube.com/ycubed
Twitch KylieYing: https://www.twitch.tv/kylieying
Twitter @kylieyying: https://twitter.com/kylieyying
Instagram @kylieyying: https://www.instagram.com/kylieyying/
Website: https://www.kylieying.com
Github: https://www.github.com/kying18
Programmer Beast Mode Spotify playlist: https://open.spotify.com/playlist/4Akns5EUb3gzmlXIdsJkPs?si=qGc4ubKRRYmPHAJAIrCxVQ
"""

import random

class Vertex(object):
def __init__(self, value):
pass

def add_edge_to(self, vertex, weight=0):
pass

def increment_edge(self, vertex):
pass

def get_adjacent_nodes(self):
pass

# initializes probability map
def get_probability_map(self):
pass

def next_word(self):
pass



class Graph(object):
def __init__(self):
pass

def get_vertex_values(self):
pass

def add_vertex(self, value):
pass

def get_vertex(self, value):
pass

def get_next_word(self, current_vertex):
pass

def generate_probability_mappings(self):
pass

0 comments on commit 3d844c6

Please sign in to comment.