Skip to content
This repository has been archived by the owner on Mar 7, 2018. It is now read-only.

Commit

Permalink
Replace Func<T> with Consumer<T>
Browse files Browse the repository at this point in the history
  • Loading branch information
c-w committed Jun 6, 2017
1 parent d3f82e4 commit 23d6409
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Expand Up @@ -26,7 +26,7 @@ libraryDependencies ++= Seq(
"com.microsoft.azure" % "applicationinsights-logging-log4j1_2" % "1.0.6",
"com.github.catalystcode" % "streaming-instagram_2.11" % "0.0.5",
"com.github.catalystcode" % "streaming-facebook_2.11" % "0.0.1",
"com.github.catalystcode" % "speechtotext-websockets-java" % "0.0.6",
"com.github.catalystcode" % "speechtotext-websockets-java" % "0.0.7",
"org.apache.bahir" %% "spark-streaming-twitter" % "2.1.0",
"org.apache.commons" % "commons-collections4" % "4.1",
"com.microsoft.azure" %% "spark-streaming-eventhubs" % "2.0.5",
Expand Down
Expand Up @@ -3,10 +3,10 @@ package com.microsoft.partnercatalyst.fortis.spark.streamwrappers.radio
import java.io.InputStream
import java.net.URL
import java.util.Locale
import java.util.function.Consumer

import com.github.catalystcode.fortis.speechtotext.Transcriber
import com.github.catalystcode.fortis.speechtotext.config.{OutputFormat, SpeechServiceConfig, SpeechType}
import com.github.catalystcode.fortis.speechtotext.utils.Func
import org.apache.spark.storage.StorageLevel
import org.apache.spark.streaming.receiver.Receiver

Expand All @@ -24,15 +24,15 @@ class TranscriptionReceiver(
private var audioStream: InputStream = _
private var transcriber: Transcriber = _

private lazy val onTranscription = new Func[String] {
override def call(text: String): Unit = {
private val onTranscription = new Consumer[String] {
override def accept(text: String): Unit = {
val transcription = RadioTranscription(text = text, language = language, radioUrl = radioUrl)
store(transcription)
}
}

private lazy val onHypothesis = new Func[String] {
override def call(text: String): Unit = {
private val onHypothesis = new Consumer[String] {
override def accept(hypothesis: String): Unit = {
// do nothing
}
}
Expand Down

0 comments on commit 23d6409

Please sign in to comment.