Skip to content

Commit

Permalink
pipe is being painful, trying amp instead take 2
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdemarzi committed Jan 10, 2012
1 parent 3048d36 commit e14bf73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion neoflix.rb
Expand Up @@ -29,7 +29,7 @@ def create_graph(neo)
'http://neoflix.heroku.com/movies.dat'.toURL().eachLine { def line ->
def components = line.split('::');
def movieVertex = g.addVertex(['type':'Movie', 'movieId':components[0].toInteger(), 'title':components[1]]);
components[2].split(/\\|/).each { def genera ->
components[2].split('&').each { def genera ->
def hits = g.idx(Tokens.T.v)[[genera:genera]].iterator();
def generaVertex = hits.hasNext() ? hits.next() : g.addVertex(['type':'Genera', 'genera':genera]);
g.addEdge(movieVertex, generaVertex, 'hasGenera');
Expand Down

0 comments on commit e14bf73

Please sign in to comment.