From aacd7ec8b6425e174992d86332ec4f3a1fe15a44 Mon Sep 17 00:00:00 2001 From: Magdalena Kalin Date: Wed, 23 Oct 2019 15:34:39 +0200 Subject: [PATCH] lol --- lol.rb | 4 ++-- pdf-parser.rb | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lol.rb b/lol.rb index 5306161..b633d91 100644 --- a/lol.rb +++ b/lol.rb @@ -1,3 +1,5 @@ +# Hi! Steffan was here... + require_relative 'find_algos' require_relative 'sorting_algos' require_relative 'Type' @@ -5,8 +7,6 @@ require_relative 'Functional_Maggie' require_relative 'Filter' require_relative 'pdf-parser' -# Hi! Steffan was here... - prim_class, container, class_fields, container_params, container_methods_maggie = parse "flight.pdf" name = prim_class diff --git a/pdf-parser.rb b/pdf-parser.rb index 6e455d3..3e8c7de 100644 --- a/pdf-parser.rb +++ b/pdf-parser.rb @@ -5,6 +5,7 @@ def parse(exam_text) reader = PDF::Reader.new(exam_text) text = reader.pages[0].text.split "\n" + content = text.slice(3, 15).map {|x| x.split " "}.map {|x| x.filter {|y| y.length > 1 and y.strip != "*"} }.filter {|x| x.length > 0} prim_class = content[0][0] @@ -51,4 +52,4 @@ def parse(exam_text) return prim_class, container, class_fields, container_params, container_methods end -parse("ferry.pdf") +puts parse("ferry.pdf")