File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
app/src/main/java/com/kylecorry/bell/infrastructure/alerts/fire Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ import java.time.ZoneId
2222class InciwebWildfireAlertSource (context : Context ) : AlertSource {
2323
2424 private val lastUpdatedDateRegex = Regex (" Last updated: (\\ d{4}-\\ d{2}-\\ d{2})" )
25- private val stateRegex = Regex (" State: (\\ w+)" )
25+ private val stateRegex = Regex (" State: ([ \\ w\\ s] +)" )
2626 private val fireNameRegex = Regex (" [A-Z0-9]+\\ s(.+)\\ sFire" )
2727
2828 private val loader = AlertLoader (context)
@@ -69,7 +69,7 @@ class InciwebWildfireAlertSource(context: Context) : AlertSource {
6969 ?.let { DateTimeParser .parseInstant(it, ZoneId .of(" America/New_York" )) }
7070 ? : originalSent
7171
72- var state = stateRegex.find(description)?.groupValues?.get(1 )
72+ var state = stateRegex.find(description)?.groupValues?.get(1 )?.trim()
7373 if (state.isNullOrBlank()) {
7474 val words = SimpleWordTokenizer ().tokenize(description).toSet()
7575 state = words.firstOrNull { word -> StateUtils .isState(word, false ) }
You can’t perform that action at this time.
0 commit comments