Skip to content

Commit

Permalink
Merge branch 'master' of github.com:dshimo/SpeechScrubber
Browse files Browse the repository at this point in the history
  • Loading branch information
steven1046 committed Nov 8, 2018
2 parents cab4077 + 9156e4b commit bc49c1d
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/main/java/com/speechscrubber/parser/TimeStampJSONParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,25 @@ public TimeStampJSONParser(JsonObject transcript, String searchString) {

OrderedJSONObject jsonObject = (OrderedJSONObject) transcript;

if(jsonObject == null)
return;

JSONArray monologues = (JSONArray) jsonObject.get("monologues");

JSONObject speaker1 = (JSONObject) monologues.get(1);
if(monologues == null)
return;

// TODO: Handle more than one speaker
JSONObject speaker = (JSONObject) monologues.get(0);

JSONArray elements = (JSONArray) speaker1.get("elements");
if(speaker == null)
return;

JSONArray elements = (JSONArray) speaker.get("elements");

if(elements == null)
return;

String[] sentenceArray = searchString.split(" ");
Double time = null;
boolean done = false;
Expand Down

0 comments on commit bc49c1d

Please sign in to comment.