mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 04:50:36 +03:00
Refactoring: spelling updates
This commit is contained in:
parent
6e12aff5c6
commit
87d3152e6c
37
.vscode/settings.json
vendored
37
.vscode/settings.json
vendored
|
@ -37,24 +37,56 @@
|
||||||
"javascriptreact"
|
"javascriptreact"
|
||||||
],
|
],
|
||||||
"cSpell.words": [
|
"cSpell.words": [
|
||||||
|
"ablt",
|
||||||
|
"accs",
|
||||||
|
"actv",
|
||||||
|
"ADJF",
|
||||||
|
"ADJS",
|
||||||
|
"ADVB",
|
||||||
"Analyse",
|
"Analyse",
|
||||||
|
"Backquote",
|
||||||
|
"BIGPR",
|
||||||
"cctext",
|
"cctext",
|
||||||
|
"CIHT",
|
||||||
"clsx",
|
"clsx",
|
||||||
"codemirror",
|
"codemirror",
|
||||||
"Constituenta",
|
"Constituenta",
|
||||||
|
"csrftoken",
|
||||||
"cstlist",
|
"cstlist",
|
||||||
"csttype",
|
"csttype",
|
||||||
|
"datv",
|
||||||
"Debool",
|
"Debool",
|
||||||
"Decart",
|
"Decart",
|
||||||
|
"EMPTYSET",
|
||||||
"exteor",
|
"exteor",
|
||||||
|
"femn",
|
||||||
|
"filterset",
|
||||||
"forceatlas",
|
"forceatlas",
|
||||||
|
"futr",
|
||||||
"Grammeme",
|
"Grammeme",
|
||||||
"Grammemes",
|
"Grammemes",
|
||||||
|
"GRND",
|
||||||
|
"impr",
|
||||||
|
"inan",
|
||||||
|
"indc",
|
||||||
|
"INFN",
|
||||||
|
"Infr",
|
||||||
|
"INTJ",
|
||||||
"Keymap",
|
"Keymap",
|
||||||
"lezer",
|
"lezer",
|
||||||
|
"Litr",
|
||||||
|
"loct",
|
||||||
"moprho",
|
"moprho",
|
||||||
|
"nomn",
|
||||||
"nooverlap",
|
"nooverlap",
|
||||||
|
"NPRO",
|
||||||
|
"NUMR",
|
||||||
|
"perfectivity",
|
||||||
"ponomarev",
|
"ponomarev",
|
||||||
|
"PRCL",
|
||||||
|
"PRTF",
|
||||||
|
"PRTS",
|
||||||
|
"pssv",
|
||||||
"pyconcept",
|
"pyconcept",
|
||||||
"pymorphy",
|
"pymorphy",
|
||||||
"Quantor",
|
"Quantor",
|
||||||
|
@ -69,10 +101,13 @@
|
||||||
"rstemplates",
|
"rstemplates",
|
||||||
"SIDELIST",
|
"SIDELIST",
|
||||||
"signup",
|
"signup",
|
||||||
|
"Slng",
|
||||||
|
"SMALLPR",
|
||||||
"tanstack",
|
"tanstack",
|
||||||
"toastify",
|
"toastify",
|
||||||
"tooltipic",
|
"tooltipic",
|
||||||
"Viewset",
|
"Viewset",
|
||||||
|
"viewsets",
|
||||||
"wordform",
|
"wordform",
|
||||||
"Wordforms",
|
"Wordforms",
|
||||||
"Булеан",
|
"Булеан",
|
||||||
|
@ -89,8 +124,10 @@
|
||||||
"Родоструктурная",
|
"Родоструктурная",
|
||||||
"Родоструктурное",
|
"Родоструктурное",
|
||||||
"Синглетон",
|
"Синглетон",
|
||||||
|
"твор",
|
||||||
"Терминологизация",
|
"Терминологизация",
|
||||||
"Цермелло",
|
"Цермелло",
|
||||||
|
"ЦИВТ",
|
||||||
"Экстеор",
|
"Экстеор",
|
||||||
"Экстеора",
|
"Экстеора",
|
||||||
"Экстеоре"
|
"Экстеоре"
|
||||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2023 CIHT CONCEPT
|
Copyright (c) 2024 CIHT CONCEPT
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
@ -85,7 +85,7 @@ class TestConstituentaAPI(APITestCase):
|
||||||
)
|
)
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
def test_update_resolved_norefs(self):
|
def test_update_resolved_no_refs(self):
|
||||||
data = {
|
data = {
|
||||||
'term_raw': 'New term',
|
'term_raw': 'New term',
|
||||||
'definition_raw': 'New def'
|
'definition_raw': 'New def'
|
||||||
|
@ -548,7 +548,7 @@ class TestRSFormViewset(APITestCase):
|
||||||
schema = self.owned
|
schema = self.owned
|
||||||
data = {'items': [1337]}
|
data = {'items': [1337]}
|
||||||
response = self.client.patch(
|
response = self.client.patch(
|
||||||
f'/api/rsforms/{schema.item.id}/cst-multidelete',
|
f'/api/rsforms/{schema.item.id}/cst-delete-multiple',
|
||||||
data=data, format='json'
|
data=data, format='json'
|
||||||
)
|
)
|
||||||
self.assertEqual(response.status_code, 400)
|
self.assertEqual(response.status_code, 400)
|
||||||
|
@ -557,7 +557,7 @@ class TestRSFormViewset(APITestCase):
|
||||||
x2 = Constituenta.objects.create(schema=schema.item, alias='X2', cst_type='basic', order=2)
|
x2 = Constituenta.objects.create(schema=schema.item, alias='X2', cst_type='basic', order=2)
|
||||||
data = {'items': [x1.id]}
|
data = {'items': [x1.id]}
|
||||||
response = self.client.patch(
|
response = self.client.patch(
|
||||||
f'/api/rsforms/{schema.item.id}/cst-multidelete',
|
f'/api/rsforms/{schema.item.id}/cst-delete-multiple',
|
||||||
data=data, format='json'
|
data=data, format='json'
|
||||||
)
|
)
|
||||||
x2.refresh_from_db()
|
x2.refresh_from_db()
|
||||||
|
@ -571,7 +571,7 @@ class TestRSFormViewset(APITestCase):
|
||||||
x3 = Constituenta.objects.create(schema=self.unowned.item, alias='X1', cst_type='basic', order=1)
|
x3 = Constituenta.objects.create(schema=self.unowned.item, alias='X1', cst_type='basic', order=1)
|
||||||
data = {'items': [x3.id]}
|
data = {'items': [x3.id]}
|
||||||
response = self.client.patch(
|
response = self.client.patch(
|
||||||
f'/api/rsforms/{schema.item.id}/cst-multidelete',
|
f'/api/rsforms/{schema.item.id}/cst-delete-multiple',
|
||||||
data=data, format='json'
|
data=data, format='json'
|
||||||
)
|
)
|
||||||
self.assertEqual(response.status_code, 400)
|
self.assertEqual(response.status_code, 400)
|
||||||
|
@ -633,7 +633,7 @@ class TestRSFormViewset(APITestCase):
|
||||||
|
|
||||||
def test_load_trs(self):
|
def test_load_trs(self):
|
||||||
schema = self.owned
|
schema = self.owned
|
||||||
schema.item.title = 'Testt11'
|
schema.item.title = 'Test11'
|
||||||
schema.item.save()
|
schema.item.save()
|
||||||
x1 = Constituenta.objects.create(schema=schema.item, alias='X1', cst_type='basic', order=1)
|
x1 = Constituenta.objects.create(schema=schema.item, alias='X1', cst_type='basic', order=1)
|
||||||
work_dir = os.path.dirname(os.path.abspath(__file__))
|
work_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
@ -645,14 +645,14 @@ class TestRSFormViewset(APITestCase):
|
||||||
)
|
)
|
||||||
schema.item.refresh_from_db()
|
schema.item.refresh_from_db()
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
self.assertEqual(schema.item.title, 'Testt11')
|
self.assertEqual(schema.item.title, 'Test11')
|
||||||
self.assertEqual(len(response.data['items']), 25)
|
self.assertEqual(len(response.data['items']), 25)
|
||||||
self.assertEqual(schema.constituents().count(), 25)
|
self.assertEqual(schema.constituents().count(), 25)
|
||||||
self.assertFalse(Constituenta.objects.filter(pk=x1.id).exists())
|
self.assertFalse(Constituenta.objects.filter(pk=x1.id).exists())
|
||||||
|
|
||||||
def test_clone(self):
|
def test_clone(self):
|
||||||
item = self.owned.item
|
item = self.owned.item
|
||||||
item.title = 'Testt11'
|
item.title = 'Test11'
|
||||||
item.save()
|
item.save()
|
||||||
x1 = Constituenta.objects.create(schema=item, alias='X12', cst_type='basic', order=1)
|
x1 = Constituenta.objects.create(schema=item, alias='X12', cst_type='basic', order=1)
|
||||||
d1 = Constituenta.objects.create(schema=item, alias='D2', cst_type='term', order=1)
|
d1 = Constituenta.objects.create(schema=item, alias='D2', cst_type='term', order=1)
|
||||||
|
|
|
@ -194,7 +194,7 @@ class RSFormViewSet(viewsets.GenericViewSet, generics.ListAPIView, generics.Retr
|
||||||
|
|
||||||
def get_permissions(self):
|
def get_permissions(self):
|
||||||
''' Determine permission class. '''
|
''' Determine permission class. '''
|
||||||
if self.action in ['load_trs', 'cst_create', 'cst_multidelete',
|
if self.action in ['load_trs', 'cst_create', 'cst_delete_multiple',
|
||||||
'reset_aliases', 'cst_rename']:
|
'reset_aliases', 'cst_rename']:
|
||||||
permission_classes = [utils.ObjectOwnerOrAdmin]
|
permission_classes = [utils.ObjectOwnerOrAdmin]
|
||||||
else:
|
else:
|
||||||
|
@ -262,8 +262,8 @@ class RSFormViewSet(viewsets.GenericViewSet, generics.ListAPIView, generics.Retr
|
||||||
request=s.CstListSerializer,
|
request=s.CstListSerializer,
|
||||||
responses={c.HTTP_202_ACCEPTED: s.RSFormParseSerializer}
|
responses={c.HTTP_202_ACCEPTED: s.RSFormParseSerializer}
|
||||||
)
|
)
|
||||||
@action(detail=True, methods=['patch'], url_path='cst-multidelete')
|
@action(detail=True, methods=['patch'], url_path='cst-delete-multiple')
|
||||||
def cst_multidelete(self, request, pk):
|
def cst_delete_multiple(self, request, pk):
|
||||||
''' Endpoint: Delete multiple constituents. '''
|
''' Endpoint: Delete multiple constituents. '''
|
||||||
schema = self._get_schema()
|
schema = self._get_schema()
|
||||||
serializer = s.CstListSerializer(
|
serializer = s.CstListSerializer(
|
||||||
|
|
|
@ -25,7 +25,7 @@ function Footer() {
|
||||||
<TextURL text='Экстеор' href='/manuals?topic=exteor' color='clr-footer'/>
|
<TextURL text='Экстеор' href='/manuals?topic=exteor' color='clr-footer'/>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p className='clr-footer'>© 2023 ЦИВТ КОНЦЕПТ</p>
|
<p className='clr-footer'>© 2024 ЦИВТ КОНЦЕПТ</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>);
|
</footer>);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Search new icons at https://reactsvgicons.com/
|
// Search new icons at https://reactsvgicons.com/
|
||||||
|
|
||||||
interface IconSVGProps {
|
interface IconSVGProps {
|
||||||
viewbox: string
|
viewBox: string
|
||||||
size?: string
|
size?: string
|
||||||
className?: string
|
className?: string
|
||||||
props?: React.SVGProps<SVGSVGElement>
|
props?: React.SVGProps<SVGSVGElement>
|
||||||
|
@ -13,14 +13,14 @@ export interface IconProps {
|
||||||
className?: string
|
className?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
function IconSVG({ viewbox, size = '1.5rem', className, props, children }: IconSVGProps) {
|
function IconSVG({ viewBox, size = '1.5rem', className, props, children }: IconSVGProps) {
|
||||||
return (
|
return (
|
||||||
<svg
|
<svg
|
||||||
width={size}
|
width={size}
|
||||||
height={size}
|
height={size}
|
||||||
className={`w-[${size}] h-[${size}] ${className}`}
|
className={`w-[${size}] h-[${size}] ${className}`}
|
||||||
fill='currentColor'
|
fill='currentColor'
|
||||||
viewBox={viewbox}
|
viewBox={viewBox}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
@ -29,7 +29,7 @@ function IconSVG({ viewbox, size = '1.5rem', className, props, children }: IconS
|
||||||
|
|
||||||
export function EducationIcon(props: IconProps) {
|
export function EducationIcon(props: IconProps) {
|
||||||
return (
|
return (
|
||||||
<IconSVG viewbox='0 0 20 20' {...props}>
|
<IconSVG viewBox='0 0 20 20' {...props}>
|
||||||
<path d='M3.33 8L10 12l10-6-10-6L0 6h10v2H3.33zM0 8v8l2-2.22V9.2L0 8zm10 12l-5-3-2-1.2v-6l7 4.2 7-4.2v6L10 20z' />
|
<path d='M3.33 8L10 12l10-6-10-6L0 6h10v2H3.33zM0 8v8l2-2.22V9.2L0 8zm10 12l-5-3-2-1.2v-6l7 4.2 7-4.2v6L10 20z' />
|
||||||
</IconSVG>
|
</IconSVG>
|
||||||
);
|
);
|
||||||
|
@ -37,7 +37,7 @@ export function EducationIcon(props: IconProps) {
|
||||||
|
|
||||||
export function InDoorIcon(props: IconProps) {
|
export function InDoorIcon(props: IconProps) {
|
||||||
return (
|
return (
|
||||||
<IconSVG viewbox='0 0 24 24' {...props}>
|
<IconSVG viewBox='0 0 24 24' {...props}>
|
||||||
<path fill='none' d='M0 0h24v24H0z' />
|
<path fill='none' d='M0 0h24v24H0z' />
|
||||||
<path d='M10 11H4V3a1 1 0 011-1h14a1 1 0 011 1v18a1 1 0 01-1 1H5a1 1 0 01-1-1v-8h6v3l5-4-5-4v3z' />
|
<path d='M10 11H4V3a1 1 0 011-1h14a1 1 0 011 1v18a1 1 0 01-1 1H5a1 1 0 01-1-1v-8h6v3l5-4-5-4v3z' />
|
||||||
</IconSVG>
|
</IconSVG>
|
||||||
|
|
|
@ -4,11 +4,11 @@ import { Decoration, EditorView } from '@codemirror/view';
|
||||||
import { bracketsDarkT, bracketsLightT } from '@/utils/color';
|
import { bracketsDarkT, bracketsLightT } from '@/utils/color';
|
||||||
|
|
||||||
const matchingMark = Decoration.mark({class: 'cc-matchingBracket'});
|
const matchingMark = Decoration.mark({class: 'cc-matchingBracket'});
|
||||||
const nonmatchingMark = Decoration.mark({class: 'cc-nonmatchingBracket'});
|
const nonMatchingMark = Decoration.mark({class: 'cc-nonmatchingBracket'});
|
||||||
|
|
||||||
function bracketRender(match: MatchResult) {
|
function bracketRender(match: MatchResult) {
|
||||||
const decorations = [];
|
const decorations = [];
|
||||||
const mark = match.matched ? matchingMark : nonmatchingMark;
|
const mark = match.matched ? matchingMark : nonMatchingMark;
|
||||||
decorations.push(mark.range(match.start.from, match.start.to));
|
decorations.push(mark.range(match.start.from, match.start.to));
|
||||||
if (match.end) {
|
if (match.end) {
|
||||||
decorations.push(mark.range(match.end.from, match.end.to));
|
decorations.push(mark.range(match.end.from, match.end.to));
|
||||||
|
|
|
@ -28,9 +28,6 @@ export function getSymbolSubstitute(keyCode: string, shiftPressed: boolean): str
|
||||||
switch (keyCode) {
|
switch (keyCode) {
|
||||||
case 'Backquote': return '∀';
|
case 'Backquote': return '∀';
|
||||||
|
|
||||||
// qwerty = μωερτπ
|
|
||||||
// asdfgh = ασδφγλ
|
|
||||||
// zxcvbn = ζξψθβη
|
|
||||||
case 'KeyQ': return 'μ';
|
case 'KeyQ': return 'μ';
|
||||||
case 'KeyW': return 'ω';
|
case 'KeyW': return 'ω';
|
||||||
case 'KeyE': return 'ε';
|
case 'KeyE': return 'ε';
|
||||||
|
@ -52,7 +49,6 @@ export function getSymbolSubstitute(keyCode: string, shiftPressed: boolean): str
|
||||||
case 'KeyB': return 'β';
|
case 'KeyB': return 'β';
|
||||||
case 'KeyN': return 'η';
|
case 'KeyN': return 'η';
|
||||||
|
|
||||||
// punctuation
|
|
||||||
case 'BracketLeft': return '[';
|
case 'BracketLeft': return '[';
|
||||||
case 'BracketRight': return ']';
|
case 'BracketRight': return ']';
|
||||||
case 'Comma': return ',';
|
case 'Comma': return ',';
|
||||||
|
@ -110,7 +106,7 @@ export class RSTextWrapper extends CodeMirrorWrapper {
|
||||||
case TokenID.BOOL: this.envelopeWith('bool(', ')'); return true;
|
case TokenID.BOOL: this.envelopeWith('bool(', ')'); return true;
|
||||||
case TokenID.DEBOOL: this.envelopeWith('debool(', ')'); return true;
|
case TokenID.DEBOOL: this.envelopeWith('debool(', ')'); return true;
|
||||||
|
|
||||||
case TokenID.PUNC_PL: {
|
case TokenID.PUNCTUATION_PL: {
|
||||||
this.envelopeWith('(', ')');
|
this.envelopeWith('(', ')');
|
||||||
this.ref.view.dispatch({
|
this.ref.view.dispatch({
|
||||||
selection: {
|
selection: {
|
||||||
|
@ -119,7 +115,7 @@ export class RSTextWrapper extends CodeMirrorWrapper {
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case TokenID.PUNC_SL: {
|
case TokenID.PUNCTUATION_SL: {
|
||||||
this.envelopeWith('[', ']');
|
this.envelopeWith('[', ']');
|
||||||
if (hasSelection) {
|
if (hasSelection) {
|
||||||
this.ref.view.dispatch({
|
this.ref.view.dispatch({
|
||||||
|
@ -141,30 +137,30 @@ export class RSTextWrapper extends CodeMirrorWrapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
case TokenID.DECART: this.replaceWith('×'); return true;
|
case TokenID.DECART: this.replaceWith('×'); return true;
|
||||||
case TokenID.FORALL: this.replaceWith('∀'); return true;
|
case TokenID.QUANTOR_UNIVERSAL: this.replaceWith('∀'); return true;
|
||||||
case TokenID.EXISTS: this.replaceWith('∃'); return true;
|
case TokenID.QUANTOR_EXISTS: this.replaceWith('∃'); return true;
|
||||||
case TokenID.IN: this.replaceWith('∈'); return true;
|
case TokenID.SET_IN: this.replaceWith('∈'); return true;
|
||||||
case TokenID.NOTIN: this.replaceWith('∉'); return true;
|
case TokenID.SET_NOT_IN: this.replaceWith('∉'); return true;
|
||||||
case TokenID.OR: this.replaceWith('∨'); return true;
|
case TokenID.LOGIC_OR: this.replaceWith('∨'); return true;
|
||||||
case TokenID.AND: this.replaceWith('&'); return true;
|
case TokenID.LOGIC_AND: this.replaceWith('&'); return true;
|
||||||
case TokenID.SUBSET_OR_EQ: this.replaceWith('⊆'); return true;
|
case TokenID.SUBSET_OR_EQ: this.replaceWith('⊆'); return true;
|
||||||
case TokenID.IMPLICATION: this.replaceWith('⇒'); return true;
|
case TokenID.LOGIC_IMPLICATION: this.replaceWith('⇒'); return true;
|
||||||
case TokenID.INTERSECTION: this.replaceWith('∩'); return true;
|
case TokenID.SET_INTERSECTION: this.replaceWith('∩'); return true;
|
||||||
case TokenID.UNION: this.replaceWith('∪'); return true;
|
case TokenID.SET_UNION: this.replaceWith('∪'); return true;
|
||||||
case TokenID.SET_MINUS: this.replaceWith('\\'); return true;
|
case TokenID.SET_MINUS: this.replaceWith('\\'); return true;
|
||||||
case TokenID.SYMMINUS: this.replaceWith('∆'); return true;
|
case TokenID.SET_SYMMETRIC_MINUS: this.replaceWith('∆'); return true;
|
||||||
case TokenID.LIT_EMPTYSET: this.replaceWith('∅'); return true;
|
case TokenID.LIT_EMPTYSET: this.replaceWith('∅'); return true;
|
||||||
case TokenID.LIT_INTSET: this.replaceWith('Z'); return true;
|
case TokenID.LIT_WHOLE_NUMBERS: this.replaceWith('Z'); return true;
|
||||||
case TokenID.SUBSET: this.replaceWith('⊂'); return true;
|
case TokenID.SUBSET: this.replaceWith('⊂'); return true;
|
||||||
case TokenID.NOTSUBSET: this.replaceWith('⊄'); return true;
|
case TokenID.NOT_SUBSET: this.replaceWith('⊄'); return true;
|
||||||
case TokenID.EQUAL: this.replaceWith('='); return true;
|
case TokenID.EQUAL: this.replaceWith('='); return true;
|
||||||
case TokenID.NOTEQUAL: this.replaceWith('≠'); return true;
|
case TokenID.NOTEQUAL: this.replaceWith('≠'); return true;
|
||||||
case TokenID.NOT: this.replaceWith('¬'); return true;
|
case TokenID.LOGIC_NOT: this.replaceWith('¬'); return true;
|
||||||
case TokenID.EQUIVALENT: this.replaceWith('⇔'); return true;
|
case TokenID.LOGIC_EQUIVALENT: this.replaceWith('⇔'); return true;
|
||||||
case TokenID.GREATER_OR_EQ: this.replaceWith('≥'); return true;
|
case TokenID.GREATER_OR_EQ: this.replaceWith('≥'); return true;
|
||||||
case TokenID.LESSER_OR_EQ: this.replaceWith('≤'); return true;
|
case TokenID.LESSER_OR_EQ: this.replaceWith('≤'); return true;
|
||||||
case TokenID.PUNC_ASSIGN: this.replaceWith(':='); return true;
|
case TokenID.PUNCTUATION_ASSIGN: this.replaceWith(':='); return true;
|
||||||
case TokenID.PUNC_ITERATE: this.replaceWith(':∈'); return true;
|
case TokenID.PUNCTUATION_ITERATE: this.replaceWith(':∈'); return true;
|
||||||
case TokenID.MULTIPLY: this.replaceWith('*'); return true;
|
case TokenID.MULTIPLY: this.replaceWith('*'); return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -173,57 +169,47 @@ export class RSTextWrapper extends CodeMirrorWrapper {
|
||||||
processAltKey(keyCode: string, shiftPressed: boolean): boolean {
|
processAltKey(keyCode: string, shiftPressed: boolean): boolean {
|
||||||
if (shiftPressed) {
|
if (shiftPressed) {
|
||||||
switch (keyCode) {
|
switch (keyCode) {
|
||||||
// qwert
|
|
||||||
// asdfg
|
|
||||||
// zxcvb
|
|
||||||
case 'KeyE': return this.insertToken(TokenID.DECART);
|
case 'KeyE': return this.insertToken(TokenID.DECART);
|
||||||
|
|
||||||
// `123456
|
|
||||||
// ~!@#$%^
|
|
||||||
case 'Backquote': return this.insertToken(TokenID.NOTEQUAL);
|
case 'Backquote': return this.insertToken(TokenID.NOTEQUAL);
|
||||||
case 'Digit1': return this.insertToken(TokenID.NOTIN); // !
|
case 'Digit1': return this.insertToken(TokenID.SET_NOT_IN); // !
|
||||||
case 'Digit2': return this.insertToken(TokenID.NOTSUBSET); // @
|
case 'Digit2': return this.insertToken(TokenID.NOT_SUBSET); // @
|
||||||
case 'Digit3': return this.insertToken(TokenID.OR); // #
|
case 'Digit3': return this.insertToken(TokenID.LOGIC_OR); // #
|
||||||
case 'Digit4': return this.insertToken(TokenID.EQUIVALENT); // $
|
case 'Digit4': return this.insertToken(TokenID.LOGIC_EQUIVALENT); // $
|
||||||
case 'Digit5': return this.insertToken(TokenID.SYMMINUS); // %
|
case 'Digit5': return this.insertToken(TokenID.SET_SYMMETRIC_MINUS); // %
|
||||||
case 'Digit6': return this.insertToken(TokenID.PUNC_ASSIGN); // ^
|
case 'Digit6': return this.insertToken(TokenID.PUNCTUATION_ASSIGN); // ^
|
||||||
case 'Digit7': return this.insertToken(TokenID.GREATER_OR_EQ); // &
|
case 'Digit7': return this.insertToken(TokenID.GREATER_OR_EQ); // &
|
||||||
case 'Digit8': return this.insertToken(TokenID.LESSER_OR_EQ); // *
|
case 'Digit8': return this.insertToken(TokenID.LESSER_OR_EQ); // *
|
||||||
case 'Digit9': return this.insertToken(TokenID.PUNC_PL); // (
|
case 'Digit9': return this.insertToken(TokenID.PUNCTUATION_PL); // (
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (keyCode) {
|
switch (keyCode) {
|
||||||
// qwert
|
|
||||||
// asdfg
|
|
||||||
// zxcvb
|
|
||||||
case 'KeyQ': return this.insertToken(TokenID.BIGPR);
|
case 'KeyQ': return this.insertToken(TokenID.BIGPR);
|
||||||
case 'KeyW': return this.insertToken(TokenID.SMALLPR);
|
case 'KeyW': return this.insertToken(TokenID.SMALLPR);
|
||||||
case 'KeyE': return this.insertToken(TokenID.BOOLEAN);
|
case 'KeyE': return this.insertToken(TokenID.BOOLEAN);
|
||||||
case 'KeyR': return this.insertToken(TokenID.REDUCE);
|
case 'KeyR': return this.insertToken(TokenID.REDUCE);
|
||||||
case 'KeyT': return this.insertToken(TokenID.NT_RECURSIVE_FULL);
|
case 'KeyT': return this.insertToken(TokenID.NT_RECURSIVE_FULL);
|
||||||
case 'KeyA': return this.insertToken(TokenID.INTERSECTION);
|
case 'KeyA': return this.insertToken(TokenID.SET_INTERSECTION);
|
||||||
case 'KeyS': return this.insertToken(TokenID.UNION);
|
case 'KeyS': return this.insertToken(TokenID.SET_UNION);
|
||||||
case 'KeyD': return this.insertToken(TokenID.NT_DECLARATIVE_EXPR);
|
case 'KeyD': return this.insertToken(TokenID.NT_DECLARATIVE_EXPR);
|
||||||
case 'KeyF': return this.insertToken(TokenID.FILTER);
|
case 'KeyF': return this.insertToken(TokenID.FILTER);
|
||||||
case 'KeyG': return this.insertToken(TokenID.NT_IMPERATIVE_EXPR);
|
case 'KeyG': return this.insertToken(TokenID.NT_IMPERATIVE_EXPR);
|
||||||
case 'KeyZ': return this.insertToken(TokenID.LIT_INTSET);
|
case 'KeyZ': return this.insertToken(TokenID.LIT_WHOLE_NUMBERS);
|
||||||
case 'KeyX': return this.insertToken(TokenID.LIT_EMPTYSET);
|
case 'KeyX': return this.insertToken(TokenID.LIT_EMPTYSET);
|
||||||
case 'KeyC': return this.insertToken(TokenID.CARD);
|
case 'KeyC': return this.insertToken(TokenID.CARD);
|
||||||
case 'KeyV': return this.insertToken(TokenID.DEBOOL);
|
case 'KeyV': return this.insertToken(TokenID.DEBOOL);
|
||||||
case 'KeyB': return this.insertToken(TokenID.BOOL);
|
case 'KeyB': return this.insertToken(TokenID.BOOL);
|
||||||
|
|
||||||
// `123456
|
case 'Backquote': return this.insertToken(TokenID.LOGIC_NOT);
|
||||||
// ~!@#$%^
|
case 'Digit1': return this.insertToken(TokenID.SET_IN);
|
||||||
case 'Backquote': return this.insertToken(TokenID.NOT);
|
|
||||||
case 'Digit1': return this.insertToken(TokenID.IN);
|
|
||||||
case 'Digit2': return this.insertToken(TokenID.SUBSET_OR_EQ);
|
case 'Digit2': return this.insertToken(TokenID.SUBSET_OR_EQ);
|
||||||
case 'Digit3': return this.insertToken(TokenID.AND);
|
case 'Digit3': return this.insertToken(TokenID.LOGIC_AND);
|
||||||
case 'Digit4': return this.insertToken(TokenID.IMPLICATION);
|
case 'Digit4': return this.insertToken(TokenID.LOGIC_IMPLICATION);
|
||||||
case 'Digit5': return this.insertToken(TokenID.SET_MINUS);
|
case 'Digit5': return this.insertToken(TokenID.SET_MINUS);
|
||||||
case 'Digit6': return this.insertToken(TokenID.PUNC_ITERATE);
|
case 'Digit6': return this.insertToken(TokenID.PUNCTUATION_ITERATE);
|
||||||
case 'Digit7': return this.insertToken(TokenID.SUBSET);
|
case 'Digit7': return this.insertToken(TokenID.SUBSET);
|
||||||
case 'Digit8': return this.insertToken(TokenID.MULTIPLY);
|
case 'Digit8': return this.insertToken(TokenID.MULTIPLY);
|
||||||
case 'BracketLeft': return this.insertToken(TokenID.PUNC_SL);
|
case 'BracketLeft': return this.insertToken(TokenID.PUNCTUATION_SL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -16,7 +16,7 @@ interface ConstituentaPickerProps {
|
||||||
data?: IConstituenta[]
|
data?: IConstituenta[]
|
||||||
rows?: number
|
rows?: number
|
||||||
|
|
||||||
prefilterFunc?: (cst: IConstituenta) => boolean
|
onBeginFilter?: (cst: IConstituenta) => boolean
|
||||||
describeFunc?: (cst: IConstituenta) => string
|
describeFunc?: (cst: IConstituenta) => string
|
||||||
matchFunc?: (cst: IConstituenta, filter: string) => boolean
|
matchFunc?: (cst: IConstituenta, filter: string) => boolean
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ function ConstituentaPicker({
|
||||||
prefixID = prefixes.cst_list,
|
prefixID = prefixes.cst_list,
|
||||||
describeFunc = describeConstituenta,
|
describeFunc = describeConstituenta,
|
||||||
matchFunc = (cst, filter) => matchConstituenta(cst, filter, CstMatchMode.ALL),
|
matchFunc = (cst, filter) => matchConstituenta(cst, filter, CstMatchMode.ALL),
|
||||||
prefilterFunc,
|
onBeginFilter,
|
||||||
onSelectValue
|
onSelectValue
|
||||||
} : ConstituentaPickerProps) {
|
} : ConstituentaPickerProps) {
|
||||||
const { colors } = useConceptTheme();
|
const { colors } = useConceptTheme();
|
||||||
|
@ -44,7 +44,7 @@ function ConstituentaPicker({
|
||||||
if (!data) {
|
if (!data) {
|
||||||
setFilteredData([]);
|
setFilteredData([]);
|
||||||
} else {
|
} else {
|
||||||
const newData = prefilterFunc ? data.filter(prefilterFunc) : data;
|
const newData = onBeginFilter ? data.filter(onBeginFilter) : data;
|
||||||
if (filterText) {
|
if (filterText) {
|
||||||
setFilteredData(newData.filter(cst => matchFunc(cst, filterText)));
|
setFilteredData(newData.filter(cst => matchFunc(cst, filterText)));
|
||||||
} else {
|
} else {
|
||||||
|
@ -52,7 +52,7 @@ function ConstituentaPicker({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}, [data, filterText, matchFunc, prefilterFunc]);
|
}, [data, filterText, matchFunc, onBeginFilter]);
|
||||||
|
|
||||||
const columns = useMemo(
|
const columns = useMemo(
|
||||||
() => [
|
() => [
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { useEffect, useState } from 'react';
|
||||||
import SelectMulti, { SelectMultiProps } from '@/components/Common/SelectMulti';
|
import SelectMulti, { SelectMultiProps } from '@/components/Common/SelectMulti';
|
||||||
import { Grammeme } from '@/models/language';
|
import { Grammeme } from '@/models/language';
|
||||||
import { getCompatibleGrams } from '@/models/languageAPI';
|
import { getCompatibleGrams } from '@/models/languageAPI';
|
||||||
import { compareGrammemeOptions,IGrammemeOption, SelectorGrammems } from '@/utils/selectors';
|
import { compareGrammemeOptions,IGrammemeOption, SelectorGrammemes } from '@/utils/selectors';
|
||||||
|
|
||||||
interface SelectGrammemeProps extends
|
interface SelectGrammemeProps extends
|
||||||
Omit<SelectMultiProps<IGrammemeOption>, 'value' | 'onChange'> {
|
Omit<SelectMultiProps<IGrammemeOption>, 'value' | 'onChange'> {
|
||||||
|
@ -26,7 +26,7 @@ function SelectGrammeme({
|
||||||
.filter(data => Object.values(Grammeme).includes(data.value as Grammeme))
|
.filter(data => Object.values(Grammeme).includes(data.value as Grammeme))
|
||||||
.map(data => data.value as Grammeme)
|
.map(data => data.value as Grammeme)
|
||||||
);
|
);
|
||||||
setOptions(SelectorGrammems.filter(({value}) => compatible.includes(value as Grammeme)));
|
setOptions(SelectorGrammemes.filter(({value}) => compatible.includes(value as Grammeme)));
|
||||||
}, [value]);
|
}, [value]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -13,7 +13,7 @@ import { CstMatchMode } from '@/models/miscellaneous';
|
||||||
import { IConstituenta } from '@/models/rsform';
|
import { IConstituenta } from '@/models/rsform';
|
||||||
import { matchConstituenta } from '@/models/rsformAPI';
|
import { matchConstituenta } from '@/models/rsformAPI';
|
||||||
import { prefixes } from '@/utils/constants';
|
import { prefixes } from '@/utils/constants';
|
||||||
import { IGrammemeOption, SelectorGrammems } from '@/utils/selectors';
|
import { IGrammemeOption, SelectorGrammemes } from '@/utils/selectors';
|
||||||
|
|
||||||
import { IReferenceInputState } from './DlgEditReference';
|
import { IReferenceInputState } from './DlgEditReference';
|
||||||
import SelectWordForm from './SelectWordForm';
|
import SelectWordForm from './SelectWordForm';
|
||||||
|
@ -38,7 +38,7 @@ function EntityTab({ initial, items, setIsValid, setReference }: EntityTabProps)
|
||||||
const ref = parseEntityReference(initial.refRaw);
|
const ref = parseEntityReference(initial.refRaw);
|
||||||
setAlias(ref.entity);
|
setAlias(ref.entity);
|
||||||
const grams = parseGrammemes(ref.form);
|
const grams = parseGrammemes(ref.form);
|
||||||
setSelectedGrams(SelectorGrammems.filter(data => grams.includes(data.value)));
|
setSelectedGrams(SelectorGrammemes.filter(data => grams.includes(data.value)));
|
||||||
}
|
}
|
||||||
}, [initial, items]);
|
}, [initial, items]);
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ function EntityTab({ initial, items, setIsValid, setReference }: EntityTabProps)
|
||||||
prefixID={prefixes.cst_modal_list}
|
prefixID={prefixes.cst_modal_list}
|
||||||
describeFunc={cst => cst.term_resolved}
|
describeFunc={cst => cst.term_resolved}
|
||||||
matchFunc={(cst, filter) => matchConstituenta(cst, filter, CstMatchMode.TERM)}
|
matchFunc={(cst, filter) => matchConstituenta(cst, filter, CstMatchMode.TERM)}
|
||||||
prefilterFunc={cst => cst.term_resolved !== ''}
|
onBeginFilter={cst => cst.term_resolved !== ''}
|
||||||
rows={8}
|
rows={8}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { useCallback } from 'react';
|
||||||
|
|
||||||
import { Grammeme } from '@/models/language';
|
import { Grammeme } from '@/models/language';
|
||||||
import { prefixes } from '@/utils/constants';
|
import { prefixes } from '@/utils/constants';
|
||||||
import { IGrammemeOption, PremadeWordForms, SelectorGrammems } from '@/utils/selectors';
|
import { IGrammemeOption, DefaultWordForms, SelectorGrammemes } from '@/utils/selectors';
|
||||||
|
|
||||||
import WordformButton from './WordformButton';
|
import WordformButton from './WordformButton';
|
||||||
|
|
||||||
|
@ -16,12 +16,12 @@ interface SelectWordFormProps {
|
||||||
function SelectWordForm({ selected, setSelected }: SelectWordFormProps) {
|
function SelectWordForm({ selected, setSelected }: SelectWordFormProps) {
|
||||||
const handleSelect = useCallback(
|
const handleSelect = useCallback(
|
||||||
(grams: Grammeme[]) => {
|
(grams: Grammeme[]) => {
|
||||||
setSelected(SelectorGrammems.filter(({value}) => grams.includes(value as Grammeme)));
|
setSelected(SelectorGrammemes.filter(({value}) => grams.includes(value as Grammeme)));
|
||||||
}, [setSelected]);
|
}, [setSelected]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='text-sm'>
|
<div className='text-sm'>
|
||||||
{PremadeWordForms.slice(0, 12).map(
|
{DefaultWordForms.slice(0, 12).map(
|
||||||
(data, index) =>
|
(data, index) =>
|
||||||
<WordformButton key={`${prefixes.wordform_list}${index}`}
|
<WordformButton key={`${prefixes.wordform_list}${index}`}
|
||||||
text={data.text} example={data.example} grams={data.grams}
|
text={data.text} example={data.example} grams={data.grams}
|
||||||
|
|
|
@ -16,7 +16,7 @@ import { Grammeme, ITextRequest, IWordForm, IWordFormPlain } from '@/models/lang
|
||||||
import { parseGrammemes, wordFormEquals } from '@/models/languageAPI';
|
import { parseGrammemes, wordFormEquals } from '@/models/languageAPI';
|
||||||
import { HelpTopic } from '@/models/miscellaneous';
|
import { HelpTopic } from '@/models/miscellaneous';
|
||||||
import { IConstituenta, TermForm } from '@/models/rsform';
|
import { IConstituenta, TermForm } from '@/models/rsform';
|
||||||
import { IGrammemeOption, SelectorGrammemesList, SelectorGrammems } from '@/utils/selectors';
|
import { IGrammemeOption, SelectorGrammemes,SelectorGrammemesList } from '@/utils/selectors';
|
||||||
|
|
||||||
import WordFormsTable from './WordFormsTable';
|
import WordFormsTable from './WordFormsTable';
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ function DlgEditWordForms({ hideWindow, target, onSave }: DlgEditWordFormsProps)
|
||||||
|
|
||||||
function handleSelectForm(form: IWordForm) {
|
function handleSelectForm(form: IWordForm) {
|
||||||
setInputText(form.text);
|
setInputText(form.text);
|
||||||
setInputGrams(SelectorGrammems.filter(gram => form.grams.find(test => test === gram.value)));
|
setInputGrams(SelectorGrammemes.filter(gram => form.grams.find(test => test === gram.value)));
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleInflect() {
|
function handleInflect() {
|
||||||
|
@ -88,7 +88,7 @@ function DlgEditWordForms({ hideWindow, target, onSave }: DlgEditWordFormsProps)
|
||||||
}
|
}
|
||||||
textProcessor.parse(data, response => {
|
textProcessor.parse(data, response => {
|
||||||
const grams = parseGrammemes(response.result);
|
const grams = parseGrammemes(response.result);
|
||||||
setInputGrams(SelectorGrammems.filter(gram => grams.find(test => test === gram.value)));
|
setInputGrams(SelectorGrammemes.filter(gram => grams.find(test => test === gram.value)));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { RSErrorType } from '@/models/rslang';
|
||||||
import { DataCallback, postCheckExpression } from '@/utils/backendAPI';
|
import { DataCallback, postCheckExpression } from '@/utils/backendAPI';
|
||||||
import { getCstExpressionPrefix } from '@/utils/misc';
|
import { getCstExpressionPrefix } from '@/utils/misc';
|
||||||
|
|
||||||
const LOGIC_TYPIIFCATION = 'LOGIC';
|
const LOGIC_TYPIFICATION = 'LOGIC';
|
||||||
|
|
||||||
function useCheckExpression({ schema }: { schema?: IRSForm }) {
|
function useCheckExpression({ schema }: { schema?: IRSForm }) {
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
@ -18,7 +18,11 @@ function useCheckExpression({ schema }: { schema?: IRSForm }) {
|
||||||
|
|
||||||
const resetParse = useCallback(() => setParseData(undefined), []);
|
const resetParse = useCallback(() => setParseData(undefined), []);
|
||||||
|
|
||||||
function checkExpression(expression: string, activeCst?: IConstituenta, onSuccess?: DataCallback<IExpressionParse>) {
|
function checkExpression(
|
||||||
|
expression: string,
|
||||||
|
activeCst?: IConstituenta,
|
||||||
|
onSuccess?: DataCallback<IExpressionParse>
|
||||||
|
) {
|
||||||
setError(undefined);
|
setError(undefined);
|
||||||
postCheckExpression(String(schema!.id), {
|
postCheckExpression(String(schema!.id), {
|
||||||
data: { expression: expression },
|
data: { expression: expression },
|
||||||
|
@ -41,24 +45,23 @@ function useCheckExpression({ schema }: { schema?: IRSForm }) {
|
||||||
export default useCheckExpression;
|
export default useCheckExpression;
|
||||||
|
|
||||||
// ===== Internals ========
|
// ===== Internals ========
|
||||||
|
|
||||||
function checkTypeConsistency(type: CstType, typification: string, args: IArgumentInfo[]): boolean {
|
function checkTypeConsistency(type: CstType, typification: string, args: IArgumentInfo[]): boolean {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case CstType.BASE:
|
case CstType.BASE:
|
||||||
case CstType.CONSTANT:
|
case CstType.CONSTANT:
|
||||||
case CstType.STRUCTURED:
|
case CstType.STRUCTURED:
|
||||||
case CstType.TERM:
|
case CstType.TERM:
|
||||||
return typification !== LOGIC_TYPIIFCATION && args.length === 0;
|
return typification !== LOGIC_TYPIFICATION && args.length === 0;
|
||||||
|
|
||||||
case CstType.AXIOM:
|
case CstType.AXIOM:
|
||||||
case CstType.THEOREM:
|
case CstType.THEOREM:
|
||||||
return typification === LOGIC_TYPIIFCATION && args.length === 0;
|
return typification === LOGIC_TYPIFICATION && args.length === 0;
|
||||||
|
|
||||||
case CstType.FUNCTION:
|
case CstType.FUNCTION:
|
||||||
return typification !== LOGIC_TYPIIFCATION && args.length !== 0;
|
return typification !== LOGIC_TYPIFICATION && args.length !== 0;
|
||||||
|
|
||||||
case CstType.PREDICATE:
|
case CstType.PREDICATE:
|
||||||
return typification === LOGIC_TYPIIFCATION && args.length !== 0;
|
return typification === LOGIC_TYPIFICATION && args.length !== 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,6 +78,7 @@ function adjustResults(parse: IExpressionParse, emptyExpression: boolean, cstTyp
|
||||||
params: [],
|
params: [],
|
||||||
position: 0
|
position: 0
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (emptyExpression) {
|
if (emptyExpression) {
|
||||||
|
@ -85,6 +89,7 @@ function adjustResults(parse: IExpressionParse, emptyExpression: boolean, cstTyp
|
||||||
params: [],
|
params: [],
|
||||||
position: 0
|
position: 0
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!checkTypeConsistency(cstType, parse.typification, parse.args)) {
|
if (!checkTypeConsistency(cstType, parse.typification, parse.args)) {
|
||||||
|
|
|
@ -106,10 +106,10 @@ export enum TokenID {
|
||||||
ID_PREDICATE,
|
ID_PREDICATE,
|
||||||
ID_RADICAL,
|
ID_RADICAL,
|
||||||
LIT_INTEGER,
|
LIT_INTEGER,
|
||||||
LIT_INTSET,
|
LIT_WHOLE_NUMBERS,
|
||||||
LIT_EMPTYSET,
|
LIT_EMPTYSET,
|
||||||
|
|
||||||
// Aithmetic
|
// Arithmetic
|
||||||
PLUS,
|
PLUS,
|
||||||
MINUS,
|
MINUS,
|
||||||
MULTIPLY,
|
MULTIPLY,
|
||||||
|
@ -125,27 +125,27 @@ export enum TokenID {
|
||||||
NOTEQUAL,
|
NOTEQUAL,
|
||||||
|
|
||||||
// Logic predicate symbols
|
// Logic predicate symbols
|
||||||
FORALL,
|
QUANTOR_UNIVERSAL,
|
||||||
EXISTS,
|
QUANTOR_EXISTS,
|
||||||
NOT,
|
LOGIC_NOT,
|
||||||
EQUIVALENT,
|
LOGIC_EQUIVALENT,
|
||||||
IMPLICATION,
|
LOGIC_IMPLICATION,
|
||||||
OR,
|
LOGIC_OR,
|
||||||
AND,
|
LOGIC_AND,
|
||||||
|
|
||||||
// Set theory predicate symbols
|
// Set theory predicate symbols
|
||||||
IN,
|
SET_IN,
|
||||||
NOTIN,
|
SET_NOT_IN,
|
||||||
SUBSET,
|
SUBSET,
|
||||||
SUBSET_OR_EQ,
|
SUBSET_OR_EQ,
|
||||||
NOTSUBSET,
|
NOT_SUBSET,
|
||||||
|
|
||||||
// Set theory operators
|
// Set theory operators
|
||||||
DECART,
|
DECART,
|
||||||
UNION,
|
SET_UNION,
|
||||||
INTERSECTION,
|
SET_INTERSECTION,
|
||||||
SET_MINUS,
|
SET_MINUS,
|
||||||
SYMMINUS,
|
SET_SYMMETRIC_MINUS,
|
||||||
BOOLEAN,
|
BOOLEAN,
|
||||||
|
|
||||||
// Structure operations
|
// Structure operations
|
||||||
|
@ -163,19 +163,19 @@ export enum TokenID {
|
||||||
IMPERATIVE,
|
IMPERATIVE,
|
||||||
|
|
||||||
// Punctuation
|
// Punctuation
|
||||||
PUNC_DEFINE,
|
PUNCTUATION_DEFINE,
|
||||||
PUNC_STRUCT,
|
PUNCTUATION_STRUCT,
|
||||||
PUNC_ASSIGN,
|
PUNCTUATION_ASSIGN,
|
||||||
PUNC_ITERATE,
|
PUNCTUATION_ITERATE,
|
||||||
PUNC_PL,
|
PUNCTUATION_PL,
|
||||||
PUNC_PR,
|
PUNCTUATION_PR,
|
||||||
PUNC_CL,
|
PUNCTUATION_CL,
|
||||||
PUNC_CR,
|
PUNCTUATION_CR,
|
||||||
PUNC_SL,
|
PUNCTUATION_SL,
|
||||||
PUNC_SR,
|
PUNCTUATION_SR,
|
||||||
PUNC_BAR,
|
PUNCTUATION_BAR,
|
||||||
PUNC_COMMA,
|
PUNCTUATION_COMMA,
|
||||||
PUNC_SEMICOLON,
|
PUNCTUATION_SEMICOLON,
|
||||||
|
|
||||||
// ======= Non-terminal tokens =========
|
// ======= Non-terminal tokens =========
|
||||||
NT_ENUM_DECL,
|
NT_ENUM_DECL,
|
||||||
|
|
|
@ -21,34 +21,34 @@ const MAIN_FIRST_ROW: TokenID[] = [
|
||||||
|
|
||||||
const MAIN_SECOND_ROW: TokenID[] = [
|
const MAIN_SECOND_ROW: TokenID[] = [
|
||||||
TokenID.BOOLEAN,
|
TokenID.BOOLEAN,
|
||||||
TokenID.PUNC_PL,
|
TokenID.PUNCTUATION_PL,
|
||||||
TokenID.INTERSECTION,
|
TokenID.SET_INTERSECTION,
|
||||||
TokenID.LIT_EMPTYSET,
|
TokenID.LIT_EMPTYSET,
|
||||||
TokenID.FORALL,
|
TokenID.QUANTOR_UNIVERSAL,
|
||||||
TokenID.NOT,
|
TokenID.LOGIC_NOT,
|
||||||
TokenID.IN,
|
TokenID.SET_IN,
|
||||||
TokenID.SUBSET_OR_EQ,
|
TokenID.SUBSET_OR_EQ,
|
||||||
TokenID.AND,
|
TokenID.LOGIC_AND,
|
||||||
TokenID.IMPLICATION,
|
TokenID.LOGIC_IMPLICATION,
|
||||||
TokenID.SET_MINUS,
|
TokenID.SET_MINUS,
|
||||||
TokenID.PUNC_ITERATE,
|
TokenID.PUNCTUATION_ITERATE,
|
||||||
TokenID.SUBSET,
|
TokenID.SUBSET,
|
||||||
TokenID.DEBOOL
|
TokenID.DEBOOL
|
||||||
];
|
];
|
||||||
|
|
||||||
const MAIN_THIRD_ROW: TokenID[] = [
|
const MAIN_THIRD_ROW: TokenID[] = [
|
||||||
TokenID.DECART,
|
TokenID.DECART,
|
||||||
TokenID.PUNC_SL,
|
TokenID.PUNCTUATION_SL,
|
||||||
TokenID.UNION,
|
TokenID.SET_UNION,
|
||||||
TokenID.LIT_INTSET,
|
TokenID.LIT_WHOLE_NUMBERS,
|
||||||
TokenID.EXISTS,
|
TokenID.QUANTOR_EXISTS,
|
||||||
TokenID.NOTEQUAL,
|
TokenID.NOTEQUAL,
|
||||||
TokenID.NOTIN,
|
TokenID.SET_NOT_IN,
|
||||||
TokenID.NOTSUBSET,
|
TokenID.NOT_SUBSET,
|
||||||
TokenID.OR,
|
TokenID.LOGIC_OR,
|
||||||
TokenID.EQUIVALENT,
|
TokenID.LOGIC_EQUIVALENT,
|
||||||
TokenID.SYMMINUS,
|
TokenID.SET_SYMMETRIC_MINUS,
|
||||||
TokenID.PUNC_ASSIGN,
|
TokenID.PUNCTUATION_ASSIGN,
|
||||||
TokenID.EQUAL,
|
TokenID.EQUAL,
|
||||||
TokenID.GREATER_OR_EQ,
|
TokenID.GREATER_OR_EQ,
|
||||||
TokenID.LESSER_OR_EQ
|
TokenID.LESSER_OR_EQ
|
||||||
|
|
|
@ -52,7 +52,7 @@ function RSFormToolbar({
|
||||||
onClick={onDownload}
|
onClick={onDownload}
|
||||||
/>
|
/>
|
||||||
<MiniButton
|
<MiniButton
|
||||||
title={'Отслеживание ' + (isSubscribed ? 'включено' : 'выключено')}
|
title={`Отслеживание ${isSubscribed ? 'включено' : 'выключено'}`}
|
||||||
disabled={anonymous || processing}
|
disabled={anonymous || processing}
|
||||||
icon={isSubscribed
|
icon={isSubscribed
|
||||||
? <FiBell size='1.25rem' className='clr-text-primary' />
|
? <FiBell size='1.25rem' className='clr-text-primary' />
|
||||||
|
|
|
@ -45,7 +45,7 @@ describe('Testing Graph editing', () => {
|
||||||
expect(graph.hasEdge(4, 1)).toBeFalsy();
|
expect(graph.hasEdge(4, 1)).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('folding node redirectes edges', () => {
|
test('folding node redirects edges', () => {
|
||||||
const graph = new Graph([[1, 3], [2, 3], [3, 4], [3, 5], [3, 3]]);
|
const graph = new Graph([[1, 3], [2, 3], [3, 4], [3, 5], [3, 3]]);
|
||||||
graph.foldNode(3);
|
graph.foldNode(3);
|
||||||
expect(graph.hasNode(3)).toBeFalsy();
|
expect(graph.hasNode(3)).toBeFalsy();
|
||||||
|
@ -73,7 +73,7 @@ describe('Testing Graph editing', () => {
|
||||||
describe('Testing Graph sort', () => {
|
describe('Testing Graph sort', () => {
|
||||||
test('topological order', () => {
|
test('topological order', () => {
|
||||||
const graph = new Graph([[9, 1], [9, 2], [2, 1], [4, 3], [5, 9]]);
|
const graph = new Graph([[9, 1], [9, 2], [2, 1], [4, 3], [5, 9]]);
|
||||||
expect(graph.tolopogicalOrder()).toStrictEqual([5, 4, 3, 9, 2, 1]);
|
expect(graph.topologicalOrder()).toStrictEqual([5, 4, 3, 9, 2, 1]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -202,7 +202,7 @@ export class Graph {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
tolopogicalOrder(): number[] {
|
topologicalOrder(): number[] {
|
||||||
const result: number[] = [];
|
const result: number[] = [];
|
||||||
const marked = new Map<number, boolean>();
|
const marked = new Map<number, boolean>();
|
||||||
const toVisit: number[] = [];
|
const toVisit: number[] = [];
|
||||||
|
@ -235,7 +235,7 @@ export class Graph {
|
||||||
}
|
}
|
||||||
|
|
||||||
transitiveReduction() {
|
transitiveReduction() {
|
||||||
const order = this.tolopogicalOrder();
|
const order = this.topologicalOrder();
|
||||||
const marked = new Map<number, boolean>();
|
const marked = new Map<number, boolean>();
|
||||||
order.forEach(nodeID => {
|
order.forEach(nodeID => {
|
||||||
if (marked.get(nodeID)) {
|
if (marked.get(nodeID)) {
|
||||||
|
|
|
@ -203,7 +203,7 @@ export function deleteLibraryItem(target: string, request: FrontAction) {
|
||||||
|
|
||||||
export function postClaimLibraryItem(target: string, request: FrontPull<ILibraryItem>) {
|
export function postClaimLibraryItem(target: string, request: FrontPull<ILibraryItem>) {
|
||||||
AxiosPost({
|
AxiosPost({
|
||||||
title: `Claim on LibrartyItem id=${target}`,
|
title: `Claim on LibraryItem id=${target}`,
|
||||||
endpoint: `/api/library/${target}/claim`,
|
endpoint: `/api/library/${target}/claim`,
|
||||||
request: request
|
request: request
|
||||||
});
|
});
|
||||||
|
@ -211,7 +211,7 @@ export function postClaimLibraryItem(target: string, request: FrontPull<ILibrary
|
||||||
|
|
||||||
export function postSubscribe(target: string, request: FrontAction) {
|
export function postSubscribe(target: string, request: FrontAction) {
|
||||||
AxiosPost({
|
AxiosPost({
|
||||||
title: `Subscribe to LibrartyItem id=${target}`,
|
title: `Subscribe to LibraryItem id=${target}`,
|
||||||
endpoint: `/api/library/${target}/subscribe`,
|
endpoint: `/api/library/${target}/subscribe`,
|
||||||
request: request
|
request: request
|
||||||
});
|
});
|
||||||
|
@ -245,7 +245,7 @@ export function postNewConstituenta(schema: string, request: FrontExchange<ICstC
|
||||||
export function patchDeleteConstituenta(schema: string, request: FrontExchange<IConstituentaList, IRSFormData>) {
|
export function patchDeleteConstituenta(schema: string, request: FrontExchange<IConstituentaList, IRSFormData>) {
|
||||||
AxiosPatch({
|
AxiosPatch({
|
||||||
title: `Delete Constituents for RSForm id=${schema}: ${request.data.items.map(item => String(item)).join(' ')}`,
|
title: `Delete Constituents for RSForm id=${schema}: ${request.data.items.map(item => String(item)).join(' ')}`,
|
||||||
endpoint: `/api/rsforms/${schema}/cst-multidelete`,
|
endpoint: `/api/rsforms/${schema}/cst-delete-multiple`,
|
||||||
request: request
|
request: request
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ export interface IColorTheme {
|
||||||
fgDisabled: string
|
fgDisabled: string
|
||||||
fgWarning: string
|
fgWarning: string
|
||||||
|
|
||||||
// Hightlight syntax accents
|
// Highlight syntax accents
|
||||||
bgRed: string
|
bgRed: string
|
||||||
bgGreen: string
|
bgGreen: string
|
||||||
bgBlue: string
|
bgBlue: string
|
||||||
|
@ -64,7 +64,7 @@ export const lightT: IColorTheme = {
|
||||||
fgDisabled: 'var(--cl-fg-80)',
|
fgDisabled: 'var(--cl-fg-80)',
|
||||||
fgWarning: 'var(--cl-red-fg-100)',
|
fgWarning: 'var(--cl-red-fg-100)',
|
||||||
|
|
||||||
// Hightlight syntax accents
|
// Highlight syntax accents
|
||||||
bgRed: 'hsl(000, 100%, 089%)',
|
bgRed: 'hsl(000, 100%, 089%)',
|
||||||
bgGreen: 'hsl(100, 100%, 075%)',
|
bgGreen: 'hsl(100, 100%, 075%)',
|
||||||
bgBlue: 'hsl(235, 080%, 087%)',
|
bgBlue: 'hsl(235, 080%, 087%)',
|
||||||
|
@ -100,7 +100,7 @@ export const darkT: IColorTheme = {
|
||||||
fgDisabled: 'var(--cd-fg-80)',
|
fgDisabled: 'var(--cd-fg-80)',
|
||||||
fgWarning: 'var(--cd-red-fg-100)',
|
fgWarning: 'var(--cd-red-fg-100)',
|
||||||
|
|
||||||
// Hightlight syntax accents
|
// Highlight syntax accents
|
||||||
bgRed: 'hsl(000, 080%, 037%)',
|
bgRed: 'hsl(000, 080%, 037%)',
|
||||||
bgGreen: 'hsl(100, 080%, 025%)',
|
bgGreen: 'hsl(100, 080%, 025%)',
|
||||||
bgBlue: 'hsl(235, 054%, 049%)',
|
bgBlue: 'hsl(235, 054%, 049%)',
|
||||||
|
@ -303,8 +303,8 @@ export const bracketsDarkT = {
|
||||||
*/
|
*/
|
||||||
export function colorBgSyntaxTree(node: ISyntaxTreeNode, colors: IColorTheme): string {
|
export function colorBgSyntaxTree(node: ISyntaxTreeNode, colors: IColorTheme): string {
|
||||||
switch (node.typeID) {
|
switch (node.typeID) {
|
||||||
case TokenID.PUNC_DEFINE:
|
case TokenID.PUNCTUATION_DEFINE:
|
||||||
case TokenID.PUNC_STRUCT:
|
case TokenID.PUNCTUATION_STRUCT:
|
||||||
case TokenID.ID_LOCAL:
|
case TokenID.ID_LOCAL:
|
||||||
return colors.bgGreen;
|
return colors.bgGreen;
|
||||||
|
|
||||||
|
@ -314,27 +314,27 @@ export function colorBgSyntaxTree(node: ISyntaxTreeNode, colors: IColorTheme): s
|
||||||
case TokenID.ID_RADICAL:
|
case TokenID.ID_RADICAL:
|
||||||
case TokenID.LIT_INTEGER:
|
case TokenID.LIT_INTEGER:
|
||||||
case TokenID.LIT_EMPTYSET:
|
case TokenID.LIT_EMPTYSET:
|
||||||
case TokenID.LIT_INTSET:
|
case TokenID.LIT_WHOLE_NUMBERS:
|
||||||
return colors.bgTeal;
|
return colors.bgTeal;
|
||||||
|
|
||||||
case TokenID.FORALL:
|
case TokenID.QUANTOR_UNIVERSAL:
|
||||||
case TokenID.EXISTS:
|
case TokenID.QUANTOR_EXISTS:
|
||||||
case TokenID.NOT:
|
case TokenID.LOGIC_NOT:
|
||||||
case TokenID.AND:
|
case TokenID.LOGIC_AND:
|
||||||
case TokenID.OR:
|
case TokenID.LOGIC_OR:
|
||||||
case TokenID.IMPLICATION:
|
case TokenID.LOGIC_IMPLICATION:
|
||||||
case TokenID.EQUIVALENT:
|
case TokenID.LOGIC_EQUIVALENT:
|
||||||
case TokenID.GREATER:
|
case TokenID.GREATER:
|
||||||
case TokenID.LESSER:
|
case TokenID.LESSER:
|
||||||
case TokenID.EQUAL:
|
case TokenID.EQUAL:
|
||||||
case TokenID.NOTEQUAL:
|
case TokenID.NOTEQUAL:
|
||||||
case TokenID.GREATER_OR_EQ:
|
case TokenID.GREATER_OR_EQ:
|
||||||
case TokenID.LESSER_OR_EQ:
|
case TokenID.LESSER_OR_EQ:
|
||||||
case TokenID.IN:
|
case TokenID.SET_IN:
|
||||||
case TokenID.NOTIN:
|
case TokenID.SET_NOT_IN:
|
||||||
case TokenID.SUBSET_OR_EQ:
|
case TokenID.SUBSET_OR_EQ:
|
||||||
case TokenID.SUBSET:
|
case TokenID.SUBSET:
|
||||||
case TokenID.NOTSUBSET:
|
case TokenID.NOT_SUBSET:
|
||||||
return colors.bgOrange;
|
return colors.bgOrange;
|
||||||
|
|
||||||
case TokenID.NT_TUPLE:
|
case TokenID.NT_TUPLE:
|
||||||
|
@ -347,10 +347,10 @@ export function colorBgSyntaxTree(node: ISyntaxTreeNode, colors: IColorTheme): s
|
||||||
case TokenID.MULTIPLY:
|
case TokenID.MULTIPLY:
|
||||||
case TokenID.BOOLEAN:
|
case TokenID.BOOLEAN:
|
||||||
case TokenID.DECART:
|
case TokenID.DECART:
|
||||||
case TokenID.INTERSECTION:
|
case TokenID.SET_INTERSECTION:
|
||||||
case TokenID.UNION:
|
case TokenID.SET_UNION:
|
||||||
case TokenID.SET_MINUS:
|
case TokenID.SET_MINUS:
|
||||||
case TokenID.SYMMINUS:
|
case TokenID.SET_SYMMETRIC_MINUS:
|
||||||
case TokenID.REDUCE:
|
case TokenID.REDUCE:
|
||||||
case TokenID.CARD:
|
case TokenID.CARD:
|
||||||
case TokenID.BOOL:
|
case TokenID.BOOL:
|
||||||
|
@ -372,8 +372,8 @@ export function colorBgSyntaxTree(node: ISyntaxTreeNode, colors: IColorTheme): s
|
||||||
case TokenID.NT_RECURSIVE_SHORT:
|
case TokenID.NT_RECURSIVE_SHORT:
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
case TokenID.PUNC_ASSIGN:
|
case TokenID.PUNCTUATION_ASSIGN:
|
||||||
case TokenID.PUNC_ITERATE:
|
case TokenID.PUNCTUATION_ITERATE:
|
||||||
return colors.bgRed;
|
return colors.bgRed;
|
||||||
}
|
}
|
||||||
// node
|
// node
|
||||||
|
|
|
@ -5,9 +5,15 @@
|
||||||
* Description is a long description used in tooltips.
|
* Description is a long description used in tooltips.
|
||||||
*/
|
*/
|
||||||
import { GramData,Grammeme, ReferenceType } from '@/models/language';
|
import { GramData,Grammeme, ReferenceType } from '@/models/language';
|
||||||
import { CstMatchMode, DependencyMode, HelpTopic, LibraryFilterStrategy, UserAccessMode } from '@/models/miscellaneous';
|
import {
|
||||||
|
CstMatchMode, DependencyMode, HelpTopic,
|
||||||
|
LibraryFilterStrategy, UserAccessMode
|
||||||
|
} from '@/models/miscellaneous';
|
||||||
import { CstClass, CstType, ExpressionStatus, IConstituenta } from '@/models/rsform';
|
import { CstClass, CstType, ExpressionStatus, IConstituenta } from '@/models/rsform';
|
||||||
import { IArgumentInfo, IRSErrorDescription, ISyntaxTreeNode, ParsingStatus, RSErrorType, TokenID } from '@/models/rslang';
|
import {
|
||||||
|
IArgumentInfo, IRSErrorDescription, ISyntaxTreeNode,
|
||||||
|
ParsingStatus, RSErrorType, TokenID
|
||||||
|
} from '@/models/rslang';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates description for {@link IConstituenta}.
|
* Generates description for {@link IConstituenta}.
|
||||||
|
@ -56,88 +62,88 @@ export function labelConstituenta(cst: IConstituenta) {
|
||||||
*/
|
*/
|
||||||
export function labelToken(id: TokenID): string {
|
export function labelToken(id: TokenID): string {
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case TokenID.BOOLEAN: return 'ℬ()';
|
case TokenID.BOOLEAN: return 'ℬ()';
|
||||||
case TokenID.DECART: return '×';
|
case TokenID.DECART: return '×';
|
||||||
case TokenID.PUNC_PL: return '( )';
|
case TokenID.PUNCTUATION_PL: return '( )';
|
||||||
case TokenID.PUNC_SL: return '[ ]';
|
case TokenID.PUNCTUATION_SL: return '[ ]';
|
||||||
case TokenID.FORALL: return '∀';
|
case TokenID.QUANTOR_UNIVERSAL: return '∀';
|
||||||
case TokenID.EXISTS: return '∃';
|
case TokenID.QUANTOR_EXISTS: return '∃';
|
||||||
case TokenID.NOT: return '¬';
|
case TokenID.LOGIC_NOT: return '¬';
|
||||||
case TokenID.AND: return '&';
|
case TokenID.LOGIC_AND: return '&';
|
||||||
case TokenID.OR: return '∨';
|
case TokenID.LOGIC_OR: return '∨';
|
||||||
case TokenID.IMPLICATION: return '⇒';
|
case TokenID.LOGIC_IMPLICATION: return '⇒';
|
||||||
case TokenID.EQUIVALENT: return '⇔';
|
case TokenID.LOGIC_EQUIVALENT: return '⇔';
|
||||||
case TokenID.LIT_EMPTYSET: return '∅';
|
case TokenID.LIT_EMPTYSET: return '∅';
|
||||||
case TokenID.LIT_INTSET: return 'Z';
|
case TokenID.LIT_WHOLE_NUMBERS: return 'Z';
|
||||||
case TokenID.EQUAL: return '=';
|
case TokenID.EQUAL: return '=';
|
||||||
case TokenID.NOTEQUAL: return '≠';
|
case TokenID.NOTEQUAL: return '≠';
|
||||||
case TokenID.GREATER_OR_EQ: return '≥';
|
case TokenID.GREATER_OR_EQ: return '≥';
|
||||||
case TokenID.LESSER_OR_EQ: return '≤';
|
case TokenID.LESSER_OR_EQ: return '≤';
|
||||||
case TokenID.IN: return '∈';
|
case TokenID.SET_IN: return '∈';
|
||||||
case TokenID.NOTIN: return '∉';
|
case TokenID.SET_NOT_IN: return '∉';
|
||||||
case TokenID.SUBSET_OR_EQ: return '⊆';
|
case TokenID.SUBSET_OR_EQ: return '⊆';
|
||||||
case TokenID.SUBSET: return '⊂';
|
case TokenID.SUBSET: return '⊂';
|
||||||
case TokenID.NOTSUBSET: return '⊄';
|
case TokenID.NOT_SUBSET: return '⊄';
|
||||||
case TokenID.INTERSECTION: return '∩';
|
case TokenID.SET_INTERSECTION: return '∩';
|
||||||
case TokenID.UNION: return '∪';
|
case TokenID.SET_UNION: return '∪';
|
||||||
case TokenID.SET_MINUS: return '\\';
|
case TokenID.SET_MINUS: return '\\';
|
||||||
case TokenID.SYMMINUS: return '∆';
|
case TokenID.SET_SYMMETRIC_MINUS: return '∆';
|
||||||
case TokenID.NT_DECLARATIVE_EXPR: return 'D{}';
|
case TokenID.NT_DECLARATIVE_EXPR: return 'D{}';
|
||||||
case TokenID.NT_IMPERATIVE_EXPR: return 'I{}';
|
case TokenID.NT_IMPERATIVE_EXPR: return 'I{}';
|
||||||
case TokenID.NT_RECURSIVE_FULL: return 'R{}';
|
case TokenID.NT_RECURSIVE_FULL: return 'R{}';
|
||||||
case TokenID.BIGPR: return 'Pr1()';
|
case TokenID.BIGPR: return 'Pr1()';
|
||||||
case TokenID.SMALLPR: return 'pr1()';
|
case TokenID.SMALLPR: return 'pr1()';
|
||||||
case TokenID.FILTER: return 'Fi1[]()';
|
case TokenID.FILTER: return 'Fi1[]()';
|
||||||
case TokenID.REDUCE: return 'red()';
|
case TokenID.REDUCE: return 'red()';
|
||||||
case TokenID.CARD: return 'card()';
|
case TokenID.CARD: return 'card()';
|
||||||
case TokenID.BOOL: return 'bool()';
|
case TokenID.BOOL: return 'bool()';
|
||||||
case TokenID.DEBOOL: return 'debool()';
|
case TokenID.DEBOOL: return 'debool()';
|
||||||
case TokenID.PUNC_ASSIGN: return ':=';
|
case TokenID.PUNCTUATION_ASSIGN: return ':=';
|
||||||
case TokenID.PUNC_ITERATE: return ':∈';
|
case TokenID.PUNCTUATION_ITERATE: return ':∈';
|
||||||
}
|
}
|
||||||
return `no label: ${id}`;
|
return `no label: ${id}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function describeToken(id: TokenID): string {
|
export function describeToken(id: TokenID): string {
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case TokenID.BOOLEAN: return 'Булеан [Alt + E / Shift + B]';
|
case TokenID.BOOLEAN: return 'Булеан [Alt + E / Shift + B]';
|
||||||
case TokenID.DECART: return 'Декартово произведение [Alt + Shift + E / Shift + 8]';
|
case TokenID.DECART: return 'Декартово произведение [Alt + Shift + E / Shift + 8]';
|
||||||
case TokenID.PUNC_PL: return 'Скобки вокруг выражения [Alt + Shift + 9 ]';
|
case TokenID.PUNCTUATION_PL: return 'Скобки вокруг выражения [Alt + Shift + 9 ]';
|
||||||
case TokenID.PUNC_SL: return 'Скобки вокруг выражения [Alt + [ ]';
|
case TokenID.PUNCTUATION_SL: return 'Скобки вокруг выражения [Alt + [ ]';
|
||||||
case TokenID.FORALL: return 'Квантор всеобщности [`]';
|
case TokenID.QUANTOR_UNIVERSAL: return 'Квантор всеобщности [`]';
|
||||||
case TokenID.EXISTS: return 'Квантор существования [Shift + `]';
|
case TokenID.QUANTOR_EXISTS: return 'Квантор существования [Shift + `]';
|
||||||
case TokenID.NOT: return 'Отрицание [Alt + `]';
|
case TokenID.LOGIC_NOT: return 'Отрицание [Alt + `]';
|
||||||
case TokenID.AND: return 'Конъюнкция [Alt + 3 ~ Shift + 7]';
|
case TokenID.LOGIC_AND: return 'Конъюнкция [Alt + 3 ~ Shift + 7]';
|
||||||
case TokenID.OR: return 'Дизъюнкция [Alt + Shift + 3]';
|
case TokenID.LOGIC_OR: return 'Дизъюнкция [Alt + Shift + 3]';
|
||||||
case TokenID.IMPLICATION: return 'Импликация [Alt + 4]';
|
case TokenID.LOGIC_IMPLICATION: return 'Импликация [Alt + 4]';
|
||||||
case TokenID.EQUIVALENT: return 'Эквивалентность [Alt + Shift + 4]';
|
case TokenID.LOGIC_EQUIVALENT: return 'Эквивалентность [Alt + Shift + 4]';
|
||||||
case TokenID.LIT_EMPTYSET: return 'Пустое множество [Alt + X]';
|
case TokenID.LIT_EMPTYSET: return 'Пустое множество [Alt + X]';
|
||||||
case TokenID.LIT_INTSET: return 'Целые числа [Alt + Z]';
|
case TokenID.LIT_WHOLE_NUMBERS: return 'Целые числа [Alt + Z]';
|
||||||
case TokenID.EQUAL: return 'Равенство';
|
case TokenID.EQUAL: return 'Равенство';
|
||||||
case TokenID.NOTEQUAL: return 'Неравенство [Alt + Shift + `]';
|
case TokenID.NOTEQUAL: return 'Неравенство [Alt + Shift + `]';
|
||||||
case TokenID.GREATER_OR_EQ: return 'Больше или равно [Alt + Shift + 7]';
|
case TokenID.GREATER_OR_EQ: return 'Больше или равно [Alt + Shift + 7]';
|
||||||
case TokenID.LESSER_OR_EQ: return 'Меньше или равно [Alt + Shift + 8]';
|
case TokenID.LESSER_OR_EQ: return 'Меньше или равно [Alt + Shift + 8]';
|
||||||
case TokenID.IN: return 'Быть элементом (принадлежит) [Alt + 1]';
|
case TokenID.SET_IN: return 'Быть элементом (принадлежит) [Alt + 1]';
|
||||||
case TokenID.NOTIN: return 'Не принадлежит [Alt + Shift + 1]';
|
case TokenID.SET_NOT_IN: return 'Не принадлежит [Alt + Shift + 1]';
|
||||||
case TokenID.SUBSET_OR_EQ: return 'Быть частью (нестрогое подмножество) [Alt + 2]';
|
case TokenID.SUBSET_OR_EQ: return 'Быть частью (нестрогое подмножество) [Alt + 2]';
|
||||||
case TokenID.SUBSET: return 'Строгое подмножество [Alt + 7]';
|
case TokenID.SUBSET: return 'Строгое подмножество [Alt + 7]';
|
||||||
case TokenID.NOTSUBSET: return 'Не подмножество [Alt + Shift + 2]';
|
case TokenID.NOT_SUBSET: return 'Не подмножество [Alt + Shift + 2]';
|
||||||
case TokenID.INTERSECTION: return 'Пересечение [Alt + A]';
|
case TokenID.SET_INTERSECTION: return 'Пересечение [Alt + A]';
|
||||||
case TokenID.UNION: return 'Объединение [Alt + S]';
|
case TokenID.SET_UNION: return 'Объединение [Alt + S]';
|
||||||
case TokenID.SET_MINUS: return 'Разность множеств [Alt + 5]';
|
case TokenID.SET_MINUS: return 'Разность множеств [Alt + 5]';
|
||||||
case TokenID.SYMMINUS: return 'Симметрическая разность [Alt + Shift + 5]';
|
case TokenID.SET_SYMMETRIC_MINUS: return 'Симметрическая разность [Alt + Shift + 5]';
|
||||||
case TokenID.NT_DECLARATIVE_EXPR: return 'Декларативная форма определения терма [Alt + D]';
|
case TokenID.NT_DECLARATIVE_EXPR: return 'Декларативная форма определения терма [Alt + D]';
|
||||||
case TokenID.NT_IMPERATIVE_EXPR: return 'Императивная форма определения терма [Alt + G]';
|
case TokenID.NT_IMPERATIVE_EXPR: return 'Императивная форма определения терма [Alt + G]';
|
||||||
case TokenID.NT_RECURSIVE_FULL: return 'Рекурсивная (цикличная) форма определения терма [Alt + T]';
|
case TokenID.NT_RECURSIVE_FULL: return 'Рекурсивная (цикличная) форма определения терма [Alt + T]';
|
||||||
case TokenID.BIGPR: return 'Большая проекция [Alt + Q]';
|
case TokenID.BIGPR: return 'Большая проекция [Alt + Q]';
|
||||||
case TokenID.SMALLPR: return 'Малая проекция [Alt + W]';
|
case TokenID.SMALLPR: return 'Малая проекция [Alt + W]';
|
||||||
case TokenID.FILTER: return 'Фильтр [Alt + F]';
|
case TokenID.FILTER: return 'Фильтр [Alt + F]';
|
||||||
case TokenID.REDUCE: return 'Множество-сумма [Alt + R]';
|
case TokenID.REDUCE: return 'Множество-сумма [Alt + R]';
|
||||||
case TokenID.CARD: return 'Мощность [Alt + C]';
|
case TokenID.CARD: return 'Мощность [Alt + C]';
|
||||||
case TokenID.BOOL: return 'Синглетон [Alt + B]';
|
case TokenID.BOOL: return 'Синглетон [Alt + B]';
|
||||||
case TokenID.DEBOOL: return 'Десинглетон [Alt + V]';
|
case TokenID.DEBOOL: return 'Десинглетон [Alt + V]';
|
||||||
case TokenID.PUNC_ASSIGN: return 'Присвоение (императивный синтаксис) [Alt + Shift + 6]';
|
case TokenID.PUNCTUATION_ASSIGN: return 'Присвоение (императивный синтаксис) [Alt + Shift + 6]';
|
||||||
case TokenID.PUNC_ITERATE: return 'Перебор элементов множества (императивный синтаксис) [Alt + 6]';
|
case TokenID.PUNCTUATION_ITERATE: return 'Перебор элементов множества (императивный синтаксис) [Alt + 6]';
|
||||||
}
|
}
|
||||||
return `no description: ${id}`;
|
return `no description: ${id}`;
|
||||||
}
|
}
|
||||||
|
@ -232,14 +238,14 @@ new Map([
|
||||||
['forceatlas2', 'Граф: Атлас 2D'],
|
['forceatlas2', 'Граф: Атлас 2D'],
|
||||||
['forceDirected2d', 'Граф: Силы 2D'],
|
['forceDirected2d', 'Граф: Силы 2D'],
|
||||||
['forceDirected3d', 'Граф: Силы 3D'],
|
['forceDirected3d', 'Граф: Силы 3D'],
|
||||||
['treeTd2d', 'Граф: ДеревоВерт 2D'],
|
['treeTd2d', 'Граф: ДеревоВер 2D'],
|
||||||
['treeTd3d', 'Граф: ДеревоВерт 3D'],
|
['treeTd3d', 'Граф: ДеревоВер 3D'],
|
||||||
['treeLr2d', 'Граф: ДеревоГор 2D'],
|
['treeLr2d', 'Граф: ДеревоГор 2D'],
|
||||||
['treeLr3d', 'Граф: ДеревоГор 3D'],
|
['treeLr3d', 'Граф: ДеревоГор 3D'],
|
||||||
['radialOut2d', 'Граф: Радиальная 2D'],
|
['radialOut2d', 'Граф: Радиальная 2D'],
|
||||||
['radialOut3d', 'Граф: Радиальная 3D'],
|
['radialOut3d', 'Граф: Радиальная 3D'],
|
||||||
['circular2d', 'Граф: Круговая'],
|
['circular2d', 'Граф: Круговая'],
|
||||||
['hierarchicalTd', 'Граф: ИерархияВерт'],
|
['hierarchicalTd', 'Граф: ИерархияВер'],
|
||||||
['hierarchicalLr', 'Граф: ИерархияГор'],
|
['hierarchicalLr', 'Граф: ИерархияГор'],
|
||||||
['nooverlap', 'Граф: Без перекрытия']
|
['nooverlap', 'Граф: Без перекрытия']
|
||||||
]);
|
]);
|
||||||
|
@ -430,44 +436,44 @@ export function labelSyntaxTree(node: ISyntaxTreeNode): string {
|
||||||
|
|
||||||
case TokenID.NT_ENUM_DECL: return 'ENUM_DECLARATION';
|
case TokenID.NT_ENUM_DECL: return 'ENUM_DECLARATION';
|
||||||
case TokenID.NT_TUPLE_DECL: return 'TUPLE_DECLARATION';
|
case TokenID.NT_TUPLE_DECL: return 'TUPLE_DECLARATION';
|
||||||
case TokenID.PUNC_DEFINE: return 'DEFINITION';
|
case TokenID.PUNCTUATION_DEFINE: return 'DEFINITION';
|
||||||
case TokenID.PUNC_STRUCT: return 'STRUCTURE_DEFITION';
|
case TokenID.PUNCTUATION_STRUCT: return 'STRUCTURE_DEFINITION';
|
||||||
|
|
||||||
case TokenID.NT_ARG_DECL: return 'ARG';
|
case TokenID.NT_ARG_DECL: return 'ARG';
|
||||||
case TokenID.NT_FUNC_CALL: return 'CALL';
|
case TokenID.NT_FUNC_CALL: return 'CALL';
|
||||||
case TokenID.NT_ARGUMENTS: return 'ARGS';
|
case TokenID.NT_ARGUMENTS: return 'ARGS';
|
||||||
|
|
||||||
case TokenID.NT_FUNC_DEFINITION: return 'FUNCTION_DEFINITION';
|
case TokenID.NT_FUNC_DEFINITION: return 'FUNCTION_DEFINITION';
|
||||||
case TokenID.NT_IMP_DECLARE: return 'IDECLARE';
|
case TokenID.NT_IMP_DECLARE: return 'DECLARE';
|
||||||
case TokenID.NT_IMP_ASSIGN: return 'IASSIGN';
|
case TokenID.NT_IMP_ASSIGN: return 'ASSIGN';
|
||||||
case TokenID.NT_IMP_LOGIC: return 'ICHECK';
|
case TokenID.NT_IMP_LOGIC: return 'CHECK';
|
||||||
|
|
||||||
case TokenID.NT_RECURSIVE_SHORT: return labelToken(TokenID.NT_RECURSIVE_FULL);
|
case TokenID.NT_RECURSIVE_SHORT: return labelToken(TokenID.NT_RECURSIVE_FULL);
|
||||||
|
|
||||||
case TokenID.BOOLEAN:
|
case TokenID.BOOLEAN:
|
||||||
case TokenID.DECART:
|
case TokenID.DECART:
|
||||||
case TokenID.FORALL:
|
case TokenID.QUANTOR_UNIVERSAL:
|
||||||
case TokenID.EXISTS:
|
case TokenID.QUANTOR_EXISTS:
|
||||||
case TokenID.NOT:
|
case TokenID.LOGIC_NOT:
|
||||||
case TokenID.AND:
|
case TokenID.LOGIC_AND:
|
||||||
case TokenID.OR:
|
case TokenID.LOGIC_OR:
|
||||||
case TokenID.IMPLICATION:
|
case TokenID.LOGIC_IMPLICATION:
|
||||||
case TokenID.EQUIVALENT:
|
case TokenID.LOGIC_EQUIVALENT:
|
||||||
case TokenID.LIT_EMPTYSET:
|
case TokenID.LIT_EMPTYSET:
|
||||||
case TokenID.LIT_INTSET:
|
case TokenID.LIT_WHOLE_NUMBERS:
|
||||||
case TokenID.EQUAL:
|
case TokenID.EQUAL:
|
||||||
case TokenID.NOTEQUAL:
|
case TokenID.NOTEQUAL:
|
||||||
case TokenID.GREATER_OR_EQ:
|
case TokenID.GREATER_OR_EQ:
|
||||||
case TokenID.LESSER_OR_EQ:
|
case TokenID.LESSER_OR_EQ:
|
||||||
case TokenID.IN:
|
case TokenID.SET_IN:
|
||||||
case TokenID.NOTIN:
|
case TokenID.SET_NOT_IN:
|
||||||
case TokenID.SUBSET_OR_EQ:
|
case TokenID.SUBSET_OR_EQ:
|
||||||
case TokenID.SUBSET:
|
case TokenID.SUBSET:
|
||||||
case TokenID.NOTSUBSET:
|
case TokenID.NOT_SUBSET:
|
||||||
case TokenID.INTERSECTION:
|
case TokenID.SET_INTERSECTION:
|
||||||
case TokenID.UNION:
|
case TokenID.SET_UNION:
|
||||||
case TokenID.SET_MINUS:
|
case TokenID.SET_MINUS:
|
||||||
case TokenID.SYMMINUS:
|
case TokenID.SET_SYMMETRIC_MINUS:
|
||||||
case TokenID.NT_DECLARATIVE_EXPR:
|
case TokenID.NT_DECLARATIVE_EXPR:
|
||||||
case TokenID.NT_IMPERATIVE_EXPR:
|
case TokenID.NT_IMPERATIVE_EXPR:
|
||||||
case TokenID.NT_RECURSIVE_FULL:
|
case TokenID.NT_RECURSIVE_FULL:
|
||||||
|
@ -475,8 +481,8 @@ export function labelSyntaxTree(node: ISyntaxTreeNode): string {
|
||||||
case TokenID.CARD:
|
case TokenID.CARD:
|
||||||
case TokenID.BOOL:
|
case TokenID.BOOL:
|
||||||
case TokenID.DEBOOL:
|
case TokenID.DEBOOL:
|
||||||
case TokenID.PUNC_ASSIGN:
|
case TokenID.PUNCTUATION_ASSIGN:
|
||||||
case TokenID.PUNC_ITERATE:
|
case TokenID.PUNCTUATION_ITERATE:
|
||||||
return labelToken(node.typeID);
|
return labelToken(node.typeID);
|
||||||
}
|
}
|
||||||
// node
|
// node
|
||||||
|
@ -526,9 +532,9 @@ export function labelGrammeme(gram: GramData): string {
|
||||||
case Grammeme.tran: return 'Переходный: да';
|
case Grammeme.tran: return 'Переходный: да';
|
||||||
case Grammeme.intr: return 'Переходный: нет';
|
case Grammeme.intr: return 'Переходный: нет';
|
||||||
|
|
||||||
case Grammeme.pres: return 'Время: наст';
|
case Grammeme.pres: return 'Время: настоящее';
|
||||||
case Grammeme.past: return 'Время: прош';
|
case Grammeme.past: return 'Время: прошедшее';
|
||||||
case Grammeme.futr: return 'Время: буд';
|
case Grammeme.futr: return 'Время: будущее';
|
||||||
|
|
||||||
case Grammeme.per1: return 'Лицо: 1';
|
case Grammeme.per1: return 'Лицо: 1';
|
||||||
case Grammeme.per2: return 'Лицо: 2';
|
case Grammeme.per2: return 'Лицо: 2';
|
||||||
|
|
|
@ -77,7 +77,7 @@ export const SelectorGrammemesList = [
|
||||||
/**
|
/**
|
||||||
* Represents options for {@link Grammeme} selector.
|
* Represents options for {@link Grammeme} selector.
|
||||||
*/
|
*/
|
||||||
export const SelectorGrammems: IGrammemeOption[] =
|
export const SelectorGrammemes: IGrammemeOption[] =
|
||||||
SelectorGrammemesList.map(
|
SelectorGrammemesList.map(
|
||||||
gram => ({
|
gram => ({
|
||||||
value: gram,
|
value: gram,
|
||||||
|
@ -98,7 +98,7 @@ export const SelectorReferenceType = (
|
||||||
/**
|
/**
|
||||||
* Represents recommended wordforms data.
|
* Represents recommended wordforms data.
|
||||||
*/
|
*/
|
||||||
export const PremadeWordForms = [
|
export const DefaultWordForms = [
|
||||||
{ text: 'ед им', example: 'ручка', grams: [Grammeme.sing, Grammeme.nomn] },
|
{ text: 'ед им', example: 'ручка', grams: [Grammeme.sing, Grammeme.nomn] },
|
||||||
{ text: 'ед род', example: 'ручки', grams: [Grammeme.sing, Grammeme.gent] },
|
{ text: 'ед род', example: 'ручки', grams: [Grammeme.sing, Grammeme.gent] },
|
||||||
{ text: 'ед дат', example: 'ручке', grams: [Grammeme.sing, Grammeme.datv] },
|
{ text: 'ед дат', example: 'ручке', grams: [Grammeme.sing, Grammeme.datv] },
|
||||||
|
|
Loading…
Reference in New Issue
Block a user