IJPL-220746 Extract HTML_TAGS_REGEX to constant in CorpusBuilder

GitOrigin-RevId: 4a1c35d65fbd5298722a8d8660ed80240e758af0
This commit is contained in:
yana.hrynevich
2026-02-09 17:26:08 +00:00
committed by intellij-monorepo-bot
parent 16ba4b6875
commit b64f5e5ac4
@@ -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)