feat: ж/д слой + cant_swim в скоринг + профили вне модели
Определение специфических рекомендаций (матрица профилей §8):
1. Ж/д слой (закрыт мёртвый railway ×2.5 у РАС):
- /api/v1/water/{case_id} отдаёт railway=rail как LineString
(без service/industrial/military веток), кэш общий v2;
- railway_warning «перекрыть/проверить немедленно» по профилям;
- SearchMap: Polyline слой ж/д (тёмно-красный), счётчики 💧/🚂.
2. cant_swim → профиль не_умеет_плавать (water ×3.0, без изменения
радиуса, critical_warning «обследовать водоёмы НЕМЕДЛЕННО»):
- раньше чекбокс влиял только на текст, в скоринге был пробел;
- derive в analyze._derive_profiles — работает и для closed_cases.
3. unmodeled_profiles: ДЦП/слабое зрение/слух — честная пометка
«вне поведенческой модели» с пояснением (vector_tasks B12:
профили без аналога не выдавать за учтённые); блок на фронте
в карточке здоровья.
Площадь воды: сферический эксцесс, проверен на квадрате 53° (744017 м²
vs 743272 точного). Тесты: 202 passed (новый test_cant_swim_profile).
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
"""
|
||||
pygments.lexers.asc
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Lexer for various ASCII armored files.
|
||||
|
||||
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
import re
|
||||
|
||||
from pygments.lexer import RegexLexer, bygroups
|
||||
from pygments.token import Comment, Generic, Name, Operator, String, Whitespace
|
||||
|
||||
__all__ = ['AscLexer']
|
||||
|
||||
|
||||
class AscLexer(RegexLexer):
|
||||
"""
|
||||
Lexer for ASCII armored files, containing `-----BEGIN/END ...-----` wrapped
|
||||
base64 data.
|
||||
"""
|
||||
name = 'ASCII armored'
|
||||
aliases = ['asc', 'pem']
|
||||
filenames = [
|
||||
'*.asc', # PGP; *.gpg, *.pgp, and *.sig too, but those can be binary
|
||||
'*.pem', # X.509; *.cer, *.crt, *.csr, and key etc too, but those can be binary
|
||||
'id_dsa', 'id_ecdsa', 'id_ecdsa_sk', 'id_ed25519', 'id_ed25519_sk',
|
||||
'id_rsa', # SSH private keys
|
||||
]
|
||||
mimetypes = ['application/pgp-keys', 'application/pgp-encrypted',
|
||||
'application/pgp-signature', 'application/pem-certificate-chain']
|
||||
url = 'https://www.openpgp.org'
|
||||
version_added = '2.10'
|
||||
|
||||
flags = re.MULTILINE
|
||||
|
||||
tokens = {
|
||||
'root': [
|
||||
(r'\s+', Whitespace),
|
||||
(r'^-----BEGIN [^\n]+-----$', Generic.Heading, 'data'),
|
||||
(r'\S+', Comment),
|
||||
],
|
||||
'data': [
|
||||
(r'\s+', Whitespace),
|
||||
(r'^([^:]+)(:)([ \t]+)(.*)',
|
||||
bygroups(Name.Attribute, Operator, Whitespace, String)),
|
||||
(r'^-----END [^\n]+-----$', Generic.Heading, 'root'),
|
||||
(r'\S+', String),
|
||||
],
|
||||
}
|
||||
|
||||
def analyse_text(text):
|
||||
if re.search(r'^-----BEGIN [^\n]+-----\r?\n', text):
|
||||
return True
|
||||
Reference in New Issue
Block a user