Don't allow selection of lemmas containing numerals (#3479)

* Don't allow selection of lemmas containing numerals

* Limit selectable token length to 50
This commit is contained in:
Kelrap 2025-07-16 13:51:54 -04:00 committed by GitHub
parent 85c9b12bc4
commit b94611340a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -157,7 +157,12 @@ class HtmlMessage extends StatelessWidget {
// #Pangea
List<PangeaToken>? get tokens =>
pangeaMessageEvent?.messageDisplayRepresentation?.tokens
?.where((t) => t.pos != "PUNCT")
?.where(
(t) =>
t.pos != "PUNCT" &&
!t.lemma.text.contains(RegExp(r'[0-9]')) &&
t.lemma.text.length <= 50,
)
.toList();
PangeaToken? getToken(