mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-220746 Extract HTML_TAGS_REGEX to constant in CorpusBuilder
GitOrigin-RevId: 4a1c35d65fbd5298722a8d8660ed80240e758af0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
16ba4b6875
commit
b64f5e5ac4
+2
-1
@@ -123,7 +123,7 @@ internal class CorpusBuilder(coroutineScope: CoroutineScope) {
|
||||
|
||||
if (configurable is ConfigurableWrapper) {
|
||||
configurable.extensionPoint.pluginDescriptor.description
|
||||
?.replace(Regex("<[^>]*>"), "") // matches everything enclosed in < and > and removes any HTML-like tags.
|
||||
?.replace(HTML_TAGS_REGEX, "") // matches everything enclosed in < and > and removes any HTML-like tags.
|
||||
?.split('.', '\n')
|
||||
?.mapNotNull { tokenizeText(it) }
|
||||
?.let { collectedTokens.addAll(it) }
|
||||
@@ -139,6 +139,7 @@ internal class CorpusBuilder(coroutineScope: CoroutineScope) {
|
||||
}
|
||||
|
||||
private val alphabeticPattern = Pattern.compile("^[a-zA-Z]+$")
|
||||
private val HTML_TAGS_REGEX = Regex("<[^>]*>")
|
||||
|
||||
private fun tokenizeText(text: String): List<String>? =
|
||||
splitText(text)
|
||||
|
||||
Reference in New Issue
Block a user