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,68 @@
|
||||
"""
|
||||
pygments.lexers.rell
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Lexers for the Rell language.
|
||||
|
||||
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from pygments.lexer import RegexLexer, bygroups, default, words
|
||||
from pygments.token import Comment, Keyword, Name, String, Number, \
|
||||
Punctuation, Whitespace
|
||||
|
||||
__all__ = ['RellLexer']
|
||||
|
||||
|
||||
class RellLexer(RegexLexer):
|
||||
"""
|
||||
A Lexer for Rell.
|
||||
"""
|
||||
name = 'Rell'
|
||||
url = 'https://docs.chromia.com/rell/rell-intro'
|
||||
aliases = ['rell']
|
||||
filenames = ['*.rell']
|
||||
mimetypes = ['text/x-rell']
|
||||
version_added = '2.20'
|
||||
|
||||
ident = r'[a-zA-Z_][a-zA-Z0-9_]*'
|
||||
|
||||
tokens = {
|
||||
'root': [
|
||||
(words((
|
||||
'big_integer', 'boolean', 'byte_array', 'decimal', 'gtv',
|
||||
'integer', 'json', 'list', 'map', 'mutable', 'set', 'text',
|
||||
'virtual'), suffix=r'\b'),
|
||||
Keyword.Type),
|
||||
(r'(false|true|null)\b', Keyword.Constant),
|
||||
(r'(entity|enum|namespace|object|struct)\b', Keyword.Declaration),
|
||||
(r'(function|operation|query)\b', Keyword.Declaration, 'function'),
|
||||
(words((
|
||||
'abstract', 'and', 'break', 'continue', 'create', 'delete',
|
||||
'else', 'for', 'if', 'import', 'in', 'index', 'key', 'limit',
|
||||
'module', 'not', 'offset', 'or', 'override', 'return', 'update',
|
||||
'val', 'var', 'when', 'while'), suffix=r'\b'),
|
||||
Keyword.Reserved),
|
||||
(r'//.*?$', Comment.Single),
|
||||
(r'/\*[\s\S]*?\*/', Comment.Multiline),
|
||||
(r'"(\\\\|\\"|[^"])*"', String.Double),
|
||||
(r'\'(\\\\|\\\'|[^\\\'])*\'', String.Single),
|
||||
(r'-?[0-9]*\.[0-9]+([eE][+-][0-9]+)?', Number.Float),
|
||||
(r'-?[0-9]+([eE][+-][0-9]+|[lL])?', Number.Integer),
|
||||
(r'x(\'[a-fA-F0-9]*\'|"[a-fA-F0-9]*")', String.Binary),
|
||||
(r'(\.)([ \n\t\r]*)(' + ident + ')',
|
||||
bygroups(Punctuation, Whitespace, Name.Attribute)),
|
||||
(r'[{}():;,]+', Punctuation),
|
||||
(r'[ \n\t\r]+', Whitespace),
|
||||
(r'@[a-zA-Z_][a-zA-Z0-9_]*', Name.Decorator),
|
||||
(r'[~^*!%&\[\]<>|+=/?\-@\$]', Punctuation.Marker),
|
||||
(ident, Name),
|
||||
(r'(\.)+', Punctuation),
|
||||
],
|
||||
'function': [
|
||||
(r'[ \n\t\r]+', Whitespace),
|
||||
(ident, Name.Function, '#pop'),
|
||||
default('#pop'),
|
||||
],
|
||||
}
|
||||
Reference in New Issue
Block a user