score:1
you should extend
serializable
(orjava.io.serializable
).serializable
is a deprecated annotation.you can't serialize arbitrary functions (like
dist
).
one workaround i can suggest:
// require that distance functions be serializable
trait distfunction extends (string, string) => int with serializable
object levenshtein {
val distance: distfunction = ...
}
class bktree(terms: seq[string], dist: distfunction) extends serializable
...
note that you'll have to ensure your distance
implementation actually is serializable.
Source: stackoverflow.com
Related Query
- How can I use Gson in Scala to serialize a List?
- How to serialize Scala Map to Json in PlayFramework?
- How to use Jackson to serialize Scala value classes as strings?
- How to serialize a Scala object to Json which already contains some Json
- How to serialize scala object with multiple-arg constructor using Jackson?
- How do I serialize CharSequence to JSON with Play 2.1 and Scala
- How to serialize a simple scala class to a CSV file?
- How to serialize Scala lambda for interop with Java method?
- How to serialize a java.util.Map[String, Object] to JSON in Scala using Play 2.3.9?
- How to serialize a Scala Collection List into json using Gson lib
- How to serialize scala BKTree?
- Scala Slick: how to serialize the result of a query to a variable table
- how to serialize Scala Array of types to JSON array in HTTP response using Spray?
- How to read environment variables in Scala
- How to quit scala 2.11.0 REPL?
- How to get Scala List from Java List?
- How do I view the type of a scala expression in IntelliJ
- How to update a mongo record using Rogue with MongoCaseClassField when case class contains a scala Enumeration
- How is pattern matching in Scala implemented at the bytecode level?
- How to parse JSON in Scala using standard Scala classes?
- Scala how can I count the number of occurrences in a list
- How to convert a java.util.List to a Scala list
- How to sort a list in Scala by two fields?
- How do I get the Scala version from within Scala itself?
- In Scala how do I remove duplicates from a list?
- How do I apply the enrich-my-library pattern to Scala collections?
- How to iterate scala map?
- How to pass Scala array into Scala vararg method?
- How to read a file as a byte array in Scala
- How in Scala to find unique items in List
More Query from same tag
- SBT dependsOn usage - migration from 0.12 to 0.13
- Scala Argument Capture of External Class
- Is it possible to Reset long accumulator at each partition in Spark?
- Can I destructure (pattern extract) a Scala list into a reused var?
- How to use google pubsub library with scala
- Readonly lens for a function
- In ReactiveMongo 0.18.8, how can I perform an update of several documents, with different values, in a single command?
- Check the Metastore for the Table availability in Spark
- apply method is not being called
- Incomprehensible syntax in Scala
- Retrieving values of attributes in scala
- Scala Parallel Collections: Change default Pool
- Scala Stream prepend returns List instead of Stream
- Scala Pattern Matching Error, "bad simple pattern: bad use of _* (sequence pattern not allowed)"
- How to ceil the result for UInt division in Chisel
- running timestamp difference in spark scala
- deprecation warning when compiling: eta expansion of zero argument method
- Scala PriorityQueue conflict resolution?
- Type ranges in type member refinement
- Using Parsers with PackratParsers in scala parser combinators
- Creating json having different keys and values with spray
- Feeding Python utf-8 strings to Scala
- Overriding issues in Scala
- JavaTokenParser Parser gets confused between two types I have created
- Where is the scaladoc for scala.language.existentials?
- scala.js's generated JavaScript cannot be called from HTML: "ReferenceError"
- how to get the lowercase string and digit string from the string line then put them into a List?
- I am reading JSON data from kafka and parsing the data using spark. But I end up with JSON parser issue
- Using Joda Time in Scala (scalaj-time) with IntelliJ IDEA
- Initialize data in Mem (Chisel)