Declaration has type inferred from a platform call, which can lead to unchecked nullability issues. Specify type explicitly as nullable or non-nullable.
This commit is contained in:
+4
-3
@@ -34,6 +34,7 @@ import com.linkedin.urls.detection.UrlDetector
|
|||||||
import com.linkedin.urls.detection.UrlDetectorOptions
|
import com.linkedin.urls.detection.UrlDetectorOptions
|
||||||
import com.vitorpamplona.amethyst.service.checkNotInMainThread
|
import com.vitorpamplona.amethyst.service.checkNotInMainThread
|
||||||
import kotlinx.coroutines.CancellationException
|
import kotlinx.coroutines.CancellationException
|
||||||
|
import java.util.concurrent.ExecutorService
|
||||||
import java.util.concurrent.Executors
|
import java.util.concurrent.Executors
|
||||||
import java.util.regex.Pattern
|
import java.util.regex.Pattern
|
||||||
|
|
||||||
@@ -45,7 +46,7 @@ data class ResultOrError(
|
|||||||
)
|
)
|
||||||
|
|
||||||
object LanguageTranslatorService {
|
object LanguageTranslatorService {
|
||||||
var executorService = Executors.newCachedThreadPool()
|
var executorService: ExecutorService = Executors.newCachedThreadPool()
|
||||||
|
|
||||||
private val options =
|
private val options =
|
||||||
LanguageIdentificationOptions
|
LanguageIdentificationOptions
|
||||||
@@ -54,8 +55,8 @@ object LanguageTranslatorService {
|
|||||||
.setConfidenceThreshold(0.6f)
|
.setConfidenceThreshold(0.6f)
|
||||||
.build()
|
.build()
|
||||||
private val languageIdentification = LanguageIdentification.getClient(options)
|
private val languageIdentification = LanguageIdentification.getClient(options)
|
||||||
val lnRegex = Pattern.compile("\\blnbc[a-z0-9]+\\b", Pattern.CASE_INSENSITIVE)
|
val lnRegex: Pattern = Pattern.compile("\\blnbc[a-z0-9]+\\b", Pattern.CASE_INSENSITIVE)
|
||||||
val tagRegex =
|
val tagRegex: Pattern =
|
||||||
Pattern.compile(
|
Pattern.compile(
|
||||||
"(nostr:)?@?(nsec1|npub1|nevent1|naddr1|note1|nprofile1|nrelay1)([qpzry9x8gf2tvdw0s3jn54khce6mua7l]+)",
|
"(nostr:)?@?(nsec1|npub1|nevent1|naddr1|note1|nprofile1|nrelay1)([qpzry9x8gf2tvdw0s3jn54khce6mua7l]+)",
|
||||||
Pattern.CASE_INSENSITIVE,
|
Pattern.CASE_INSENSITIVE,
|
||||||
|
|||||||
Reference in New Issue
Block a user