mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 04:50:36 +03:00
Fix spelling via spellchecker
This commit is contained in:
parent
1df94572b7
commit
5aaf902919
|
@ -49,6 +49,8 @@ This readme file is used mostly to document project dependencies
|
|||
<pre>
|
||||
- ESLint
|
||||
- Colorize
|
||||
- Code Spell Checker (eng + rus)
|
||||
- Backticks
|
||||
</pre>
|
||||
</details>
|
||||
|
||||
|
@ -102,7 +104,7 @@ This readme file is used mostly to document project dependencies
|
|||
- run rsconcept/backend/LocalEnvSetup.ps1
|
||||
- use VSCode configs in root folder to start developement
|
||||
|
||||
## Developement build
|
||||
## Development build
|
||||
- this build does not use HTTPS and nginx for networking
|
||||
- backend and frontend debugging is supported
|
||||
- hmr (hot updates) for frontend
|
||||
|
|
|
@ -238,12 +238,12 @@ class Constituenta(Model):
|
|||
blank=True
|
||||
)
|
||||
definition_raw: TextField = TextField(
|
||||
verbose_name='Текстовое определние (с отсылками)',
|
||||
verbose_name='Текстовое определение (с отсылками)',
|
||||
default='',
|
||||
blank=True
|
||||
)
|
||||
definition_resolved: TextField = TextField(
|
||||
verbose_name='Текстовое определние',
|
||||
verbose_name='Текстовое определение',
|
||||
default='',
|
||||
blank=True
|
||||
)
|
||||
|
@ -501,8 +501,8 @@ class RSForm:
|
|||
|
||||
def _insert_new(self, data: dict, insert_after: Optional[str]=None) -> 'Constituenta':
|
||||
if insert_after is not None:
|
||||
cstafter = Constituenta.objects.get(pk=insert_after)
|
||||
return self.insert_at(cstafter.order + 1, data['alias'], data['cst_type'])
|
||||
cst_after = Constituenta.objects.get(pk=insert_after)
|
||||
return self.insert_at(cst_after.order + 1, data['alias'], data['cst_type'])
|
||||
else:
|
||||
return self.insert_last(data['alias'], data['cst_type'])
|
||||
|
||||
|
|
|
@ -481,7 +481,7 @@ class RSFormTRSSerializer(serializers.Serializer):
|
|||
or self.initial_data['version'] < _TRS_VERSION_MIN \
|
||||
or self.initial_data['version'] > _TRS_VERSION:
|
||||
raise serializers.ValidationError({
|
||||
'version': 'Некорректная версия файла Экстеор. Пересохраните файл в новой версии'
|
||||
'version': 'Некорректная версия файла Экстеор. Сохраните файл в новой версии'
|
||||
})
|
||||
return attrs
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ from apps.rsform.utils import apply_pattern, fix_old_references
|
|||
|
||||
|
||||
class TestUtils(unittest.TestCase):
|
||||
''' Test various utilitiy functions. '''
|
||||
''' Test various utility functions. '''
|
||||
def test_apply_mapping_patter(self):
|
||||
mapping = {'X101': 'X20'}
|
||||
pattern = re.compile(r'(X[0-9]+)')
|
||||
|
|
|
@ -404,7 +404,7 @@ class RSFormViewSet(viewsets.GenericViewSet, generics.ListAPIView, generics.Retr
|
|||
)
|
||||
@action(detail=True, methods=['post'])
|
||||
def resolve(self, request, pk):
|
||||
''' Endpoint: Resolve refenrces in text against schema terms context. '''
|
||||
''' Endpoint: Resolve references in text against schema terms context. '''
|
||||
serializer = s.TextSerializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
text = serializer.validated_data['text']
|
||||
|
|
|
@ -1 +1 @@
|
|||
''' Admin: User profile and Authentification. '''
|
||||
''' Admin: User profile and Authorization. '''
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
''' Application: User profile and Authentification. '''
|
||||
''' Application: User profile and Authorization. '''
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
''' Serializers: User profile and Authentification. '''
|
||||
''' Serializers: User profile and Authorization. '''
|
||||
from django.contrib.auth import authenticate
|
||||
from django.contrib.auth.password_validation import validate_password
|
||||
from rest_framework import serializers
|
||||
|
@ -15,7 +15,7 @@ class NonFieldErrorSerializer(serializers.Serializer):
|
|||
|
||||
|
||||
class LoginSerializer(serializers.Serializer):
|
||||
''' Serializer: User authentification by login/password. '''
|
||||
''' Serializer: User authentication by login/password. '''
|
||||
username = serializers.CharField(
|
||||
label='Имя пользователя',
|
||||
write_only=True
|
||||
|
@ -49,7 +49,7 @@ class LoginSerializer(serializers.Serializer):
|
|||
|
||||
|
||||
class AuthSerializer(serializers.Serializer):
|
||||
''' Serializer: Authentication data. '''
|
||||
''' Serializer: Authorization data. '''
|
||||
id = serializers.IntegerField()
|
||||
username = serializers.CharField()
|
||||
is_staff = serializers.BooleanField()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
''' Routing: User profile and Authentification. '''
|
||||
''' Routing: User profile and Authorization. '''
|
||||
from django.urls import path
|
||||
from . import views
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
''' REST API: User profile and Authentification. '''
|
||||
''' REST API: User profile and Authorization. '''
|
||||
from django.contrib.auth import login, logout
|
||||
|
||||
from rest_framework import status as c
|
||||
|
|
|
@ -54,7 +54,7 @@ class Collation:
|
|||
return self.words[self.main_word].get_parse()
|
||||
|
||||
def get_morpho(self) -> Morphology:
|
||||
''' Access parsed main mrophology. '''
|
||||
''' Access parsed main morphology. '''
|
||||
return self.words[self.main_word].get_morpho()
|
||||
|
||||
def add_word(self, segment, forms: list, main_form: int, need_coordination: bool = True):
|
||||
|
@ -332,8 +332,8 @@ class PhraseParser:
|
|||
output.add_word(segment, forms, main_index, needs_coordination)
|
||||
return segment_score
|
||||
# Alternative: return segment_score
|
||||
# penalty_suspicoius = 0 if local_max == 0 else (1 - local_sum / local_max) * self._PRIORITY_PENALTY
|
||||
# return segment_score - penalty_suspicoius
|
||||
# penalty_suspicious = 0 if local_max == 0 else (1 - local_sum / local_max) * self._PRIORITY_PENALTY
|
||||
# return segment_score - penalty_suspicious
|
||||
|
||||
@classmethod
|
||||
def _finalize_coordination(cls, target: Collation):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
''' Russian language synthax incapsulation. '''
|
||||
''' Russian language syntax incapsulation. '''
|
||||
from __future__ import annotations
|
||||
from enum import Enum, unique
|
||||
|
||||
|
@ -56,7 +56,7 @@ class Capitalization(Enum):
|
|||
|
||||
|
||||
class RuSyntax:
|
||||
''' Russian language synthax parser. '''
|
||||
''' Russian language syntax parser. '''
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ REST_FRAMEWORK = {
|
|||
'TEST_REQUEST_DEFAULT_FORMAT': 'json',
|
||||
'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema',
|
||||
'DEFAULT_AUTHENTICATION_CLASSES': [
|
||||
'rest_framework.authentication.SessionAuthentication',
|
||||
'rest_framework.authentication.SessionAuthorization',
|
||||
],
|
||||
'DEFAULT_PERMISSION_CLASSES': [
|
||||
'rest_framework.permissions.AllowAny'
|
||||
|
@ -80,7 +80,7 @@ MIDDLEWARE = [
|
|||
'corsheaders.middleware.CorsMiddleware',
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.auth.middleware.AuthorizationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
]
|
||||
|
|
|
@ -3,7 +3,7 @@ import { createBrowserRouter, Outlet, RouterProvider } from 'react-router-dom';
|
|||
import ConceptToaster from './components/ConceptToaster';
|
||||
import Footer from './components/Footer';
|
||||
import Navigation from './components/Navigation';
|
||||
import { NavigationState } from './context/NagivationContext';
|
||||
import { NavigationState } from './context/NavigationContext';
|
||||
import { useConceptTheme } from './context/ThemeContext';
|
||||
import CreateRSFormPage from './pages/CreateRSFormPage';
|
||||
import HomePage from './pages/HomePage';
|
||||
|
|
|
@ -94,4 +94,4 @@ function PaginationTools<TData>({ table, paginationOptions, onChangePaginationOp
|
|||
</div>);
|
||||
}
|
||||
|
||||
export default PaginationTools;
|
||||
export default PaginationTools;
|
|
@ -1,5 +1,5 @@
|
|||
import { useAuth } from '@/context/AuthContext';
|
||||
import { useConceptNavigation } from '@/context/NagivationContext';
|
||||
import { useConceptNavigation } from '@/context/NavigationContext';
|
||||
|
||||
import TextURL from './Common/TextURL';
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ function HelpAPI() {
|
|||
<h1>Программный интерфейс Портала</h1>
|
||||
<p>В качестве программного интерфейса сервера используется REST API, реализованный с помощью Django.</p>
|
||||
<p>На данный момент API находится в разработке, поэтому поддержка внешних запросов не производится.</p>
|
||||
<p>С описанием интерфейса можно ознакомиться <TextURL text='по ссылке' href={urls.restapi}/>.</p>
|
||||
<p><TextURL text='Принять участие в разработке' href={urls.gitrepo}/></p>
|
||||
<p>С описанием интерфейса можно ознакомиться <TextURL text='по ссылке' href={urls.restAPI}/>.</p>
|
||||
<p><TextURL text='Принять участие в разработке' href={urls.git_repo}/></p>
|
||||
</div>);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import { BiInfoCircle } from 'react-icons/bi';
|
|||
|
||||
import ConceptTooltip from '@/components/Common/ConceptTooltip';
|
||||
import TextURL from '@/components/Common/TextURL';
|
||||
import { HelpTopic } from '@/models/miscelanious';
|
||||
import { HelpTopic } from '@/models/miscellaneous';
|
||||
|
||||
import { CProps } from '../props';
|
||||
import InfoTopic from './InfoTopic';
|
||||
|
|
|
@ -8,7 +8,7 @@ function HelpLibrary() {
|
|||
<p>В библиотеки собраны различные концептуальные схемы.</p>
|
||||
<p>Группировка и классификации схем на данный момент не проводится.</p>
|
||||
<p>На текущем этапе происходит наполнение Библиотеки концептуальными схемами.</p>
|
||||
<p>Поиск осуществлеяется с помощью инструментов в верхней части страницы.</p>
|
||||
<p>Поиск осуществляется с помощью инструментов в верхней части страницы.</p>
|
||||
<div className='flex items-center gap-2'>
|
||||
<FiBell size='1rem'/>
|
||||
<p>Аттрибут <b>отслеживаемая</b> обозначает отслеживание схемы.</p>
|
||||
|
|
|
@ -15,8 +15,8 @@ function HelpMain() {
|
|||
<p>В меню пользователя (правый верхний угол) доступно редактирование данных пользователя и изменение цветовой темы.</p>
|
||||
|
||||
<p className='mt-4 mb-1 text-center'><b>Поддержка</b></p>
|
||||
<p>Портал разрабатывается <TextURL text='Центром Концепт' href={urls.concept}/> и является проектом с открытым исходным кодом, доступным на <TextURL text='Github' href={urls.gitrepo}/>.</p>
|
||||
<p>Ваши пожелания по доработке, найденные ошибки и иные предложения можно направлять по email: <TextURL href={urls.mailportal} text='portal@acconcept.ru'/></p>
|
||||
<p>Портал разрабатывается <TextURL text='Центром Концепт' href={urls.concept}/> и является проектом с открытым исходным кодом, доступным на <TextURL text='Github' href={urls.git_repo}/>.</p>
|
||||
<p>Ваши пожелания по доработке, найденные ошибки и иные предложения можно направлять по email: <TextURL href={urls.mail_portal} text='portal@acconcept.ru'/></p>
|
||||
</div>);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ function HelpTerminologyControl() {
|
|||
<p>Портал позволяет контролировать употребление терминов, привязанных к сущностям в концептуальных схемах.</p>
|
||||
<p>Для этого используется механизм текстовых отсылок: <i>использование термина</i> и <i>связывание слов.</i></p>
|
||||
<p>При отсылке к термину указывается параметры словоформы так, обеспечивающие корректное согласование слов.</p>
|
||||
<p><b>Граммема</b> - минимальная единица грамматической информаци, например род, число, падеж.</p>
|
||||
<p><b>Граммема</b> - минимальная единица грамматической информами, например род, число, падеж.</p>
|
||||
<p><b>Словоформа</b> - грамматическая форма словосочетания, которая может меняться в зависимости от его грамматических характеристик.</p>
|
||||
<p><b>Лексема</b> - все грамматические формы и словосочетания, связанные с данным словосочетанием.</p>
|
||||
<p>При работе со словосочетаниями определяется основное слово, которое определяет набор граммем и используется для согласования с другими словами в предложении.</p>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { HelpTopic } from '@/models/miscelanious';
|
||||
import { HelpTopic } from '@/models/miscellaneous';
|
||||
|
||||
import HelpAPI from './HelpAPI';
|
||||
import HelpConstituenta from './HelpConstituenta';
|
||||
|
|
|
@ -4,7 +4,7 @@ import { FaSquarePlus } from 'react-icons/fa6';
|
|||
import { IoLibrary } from 'react-icons/io5';
|
||||
|
||||
import { EducationIcon } from '@/components/Icons';
|
||||
import { useConceptNavigation } from '@/context/NagivationContext';
|
||||
import { useConceptNavigation } from '@/context/NavigationContext';
|
||||
import { useConceptTheme } from '@/context/ThemeContext';
|
||||
import { animateNavigation } from '@/utils/animations';
|
||||
|
||||
|
@ -40,7 +40,10 @@ function Navigation () {
|
|||
animate={!noNavigationAnimation ? 'open' : 'closed'}
|
||||
variants={animateNavigation}
|
||||
>
|
||||
<div className='flex items-center mr-2 cursor-pointer' onClick={navigateHome} tabIndex={-1}>
|
||||
<div tabIndex={-1}
|
||||
className='flex items-center mr-2 cursor-pointer'
|
||||
onClick={navigateHome}
|
||||
>
|
||||
<Logo />
|
||||
</div>
|
||||
<div className='flex'>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import Dropdown from '@/components/Common/Dropdown';
|
||||
import DropdownButton from '@/components/Common/DropdownButton';
|
||||
import { useAuth } from '@/context/AuthContext';
|
||||
import { useConceptNavigation } from '@/context/NagivationContext';
|
||||
import { useConceptNavigation } from '@/context/NavigationContext';
|
||||
import { useConceptTheme } from '@/context/ThemeContext';
|
||||
|
||||
interface UserDropdownProps {
|
||||
|
|
|
@ -2,7 +2,7 @@ import { FaCircleUser } from 'react-icons/fa6';
|
|||
|
||||
import { InDoorIcon } from '@/components/Icons';
|
||||
import { useAuth } from '@/context/AuthContext';
|
||||
import { useConceptNavigation } from '@/context/NagivationContext';
|
||||
import { useConceptNavigation } from '@/context/NavigationContext';
|
||||
import useDropdown from '@/hooks/useDropdown';
|
||||
|
||||
import NavigationButton from './NavigationButton';
|
||||
|
|
|
@ -4,7 +4,7 @@ import ConceptTooltip from '@/components/Common/ConceptTooltip';
|
|||
import ConstituentaTooltip from '@/components/Help/ConstituentaTooltip';
|
||||
import { IConstituenta } from '@/models/rsform';
|
||||
import { isMockCst } from '@/models/rsformAPI';
|
||||
import { colorfgCstStatus,IColorTheme } from '@/utils/color';
|
||||
import { colorFgCstStatus,IColorTheme } from '@/utils/color';
|
||||
import { describeExpressionStatus } from '@/utils/labels';
|
||||
|
||||
interface ConstituentaBadgeProps {
|
||||
|
@ -25,8 +25,8 @@ function ConstituentaBadge({ value, prefixID, shortTooltip, theme }: Constituent
|
|||
'text-center font-semibold whitespace-nowrap'
|
||||
)}
|
||||
style={{
|
||||
borderColor: colorfgCstStatus(value.status, theme),
|
||||
color: colorfgCstStatus(value.status, theme),
|
||||
borderColor: colorFgCstStatus(value.status, theme),
|
||||
color: colorFgCstStatus(value.status, theme),
|
||||
backgroundColor: isMockCst(value) ? theme.bgWarning : theme.bgInput
|
||||
}}
|
||||
>
|
||||
|
|
|
@ -3,7 +3,7 @@ import { useEffect, useMemo, useState } from 'react';
|
|||
import ConceptSearch from '@/components/Common/ConceptSearch';
|
||||
import DataTable, { createColumnHelper, IConditionalStyle } from '@/components/DataTable';
|
||||
import { useConceptTheme } from '@/context/ThemeContext';
|
||||
import { CstMatchMode } from '@/models/miscelanious';
|
||||
import { CstMatchMode } from '@/models/miscellaneous';
|
||||
import { IConstituenta } from '@/models/rsform';
|
||||
import { matchConstituenta } from '@/models/rsformAPI';
|
||||
import { prefixes } from '@/utils/constants';
|
||||
|
|
|
@ -2,7 +2,7 @@ import clsx from 'clsx';
|
|||
|
||||
import { useConceptTheme } from '@/context/ThemeContext';
|
||||
import { GramData } from '@/models/language';
|
||||
import { colorfgGrammeme } from '@/utils/color';
|
||||
import { colorFgGrammeme } from '@/utils/color';
|
||||
import { labelGrammeme } from '@/utils/labels';
|
||||
|
||||
interface GrammemeBadgeProps {
|
||||
|
@ -22,8 +22,8 @@ function GrammemeBadge({ key, grammeme }: GrammemeBadgeProps) {
|
|||
'text-sm font-semibold text-center whitespace-nowrap'
|
||||
)}
|
||||
style={{
|
||||
borderColor: colorfgGrammeme(grammeme, colors),
|
||||
color: colorfgGrammeme(grammeme, colors),
|
||||
borderColor: colorFgGrammeme(grammeme, colors),
|
||||
color: colorFgGrammeme(grammeme, colors),
|
||||
backgroundColor: colors.bgInput
|
||||
}}
|
||||
>
|
||||
|
|
|
@ -2,7 +2,7 @@ import clsx from 'clsx';
|
|||
|
||||
import { useConceptTheme } from '@/context/ThemeContext';
|
||||
import { CstClass } from '@/models/rsform';
|
||||
import { colorbgCstClass } from '@/utils/color';
|
||||
import { colorBgCstClass } from '@/utils/color';
|
||||
import { prefixes } from '@/utils/constants';
|
||||
import { describeCstClass, labelCstClass } from '@/utils/labels';
|
||||
|
||||
|
@ -28,7 +28,7 @@ function InfoCstClass({ header }: InfoCstClassProps) {
|
|||
'border',
|
||||
'text-center text-sm small-caps font-semibold'
|
||||
)}
|
||||
style={{backgroundColor: colorbgCstClass(cclass, colors)}}
|
||||
style={{backgroundColor: colorBgCstClass(cclass, colors)}}
|
||||
>
|
||||
{labelCstClass(cclass)}
|
||||
</span>
|
||||
|
|
|
@ -2,7 +2,7 @@ import clsx from 'clsx';
|
|||
|
||||
import { useConceptTheme } from '@/context/ThemeContext';
|
||||
import { ExpressionStatus } from '@/models/rsform';
|
||||
import { colorbgCstStatus } from '@/utils/color';
|
||||
import { colorBgCstStatus } from '@/utils/color';
|
||||
import { prefixes } from '@/utils/constants';
|
||||
import { describeExpressionStatus, labelExpressionStatus } from '@/utils/labels';
|
||||
|
||||
|
@ -29,7 +29,7 @@ function InfoCstStatus({ title }: InfoCstStatusProps) {
|
|||
'border',
|
||||
'text-center text-sm small-caps font-semibold'
|
||||
)}
|
||||
style={{backgroundColor: colorbgCstStatus(status, colors)}}
|
||||
style={{backgroundColor: colorBgCstStatus(status, colors)}}
|
||||
>
|
||||
{labelExpressionStatus(status)}
|
||||
</span>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import { createContext, useContext, useState } from 'react';
|
||||
|
||||
import { UserAccessMode } from '@/models/miscelanious';
|
||||
import { UserAccessMode } from '@/models/miscellaneous';
|
||||
|
||||
interface IAccessModeContext {
|
||||
mode: UserAccessMode
|
||||
|
|
|
@ -5,7 +5,7 @@ import { createContext, useCallback, useContext, useEffect, useState } from 'rea
|
|||
import { ErrorData } from '@/components/InfoError';
|
||||
import { ILibraryItem } from '@/models/library';
|
||||
import { matchLibraryItem } from '@/models/libraryAPI';
|
||||
import { ILibraryFilter } from '@/models/miscelanious';
|
||||
import { ILibraryFilter } from '@/models/miscellaneous';
|
||||
import { IRSForm, IRSFormCreateData, IRSFormData } from '@/models/rsform';
|
||||
import { loadRSFormData } from '@/models/rsformAPI';
|
||||
import { DataCallback, deleteLibraryItem, getLibrary, getRSFormDetails, getTemplates, postCloneLibraryItem, postNewRSForm } from '@/utils/backendAPI';
|
||||
|
|
|
@ -5,7 +5,7 @@ import { useLocation, useNavigate } from 'react-router-dom';
|
|||
|
||||
import { globalIDs } from '@/utils/constants';
|
||||
|
||||
interface INagivationContext{
|
||||
interface INavigationContext{
|
||||
push: (path: string) => void
|
||||
replace: (path: string) => void
|
||||
back: () => void
|
||||
|
@ -17,9 +17,9 @@ interface INagivationContext{
|
|||
setIsBlocked: (value: boolean) => void
|
||||
}
|
||||
|
||||
const NagivationContext = createContext<INagivationContext | null>(null);
|
||||
const NavigationContext = createContext<INavigationContext | null>(null);
|
||||
export const useConceptNavigation = () => {
|
||||
const context = useContext(NagivationContext);
|
||||
const context = useContext(NavigationContext);
|
||||
if (!context) {
|
||||
throw new Error('useConceptNavigation has to be used within <NavigationState.Provider>');
|
||||
}
|
||||
|
@ -95,12 +95,12 @@ export const NavigationState = ({ children }: NavigationStateProps) => {
|
|||
}, [pathname, scrollTop]);
|
||||
|
||||
return (
|
||||
<NagivationContext.Provider value={{
|
||||
<NavigationContext.Provider value={{
|
||||
push, replace, back, forward,
|
||||
canBack, isBlocked, setIsBlocked
|
||||
}}>
|
||||
{children}
|
||||
</NagivationContext.Provider>);
|
||||
</NavigationContext.Provider>);
|
||||
}
|
||||
|
||||
export function useBlockNavigation(isBlocked: boolean) {
|
|
@ -9,7 +9,7 @@ import Modal, { ModalProps } from '@/components/Common/Modal';
|
|||
import TextArea from '@/components/Common/TextArea';
|
||||
import TextInput from '@/components/Common/TextInput';
|
||||
import { useLibrary } from '@/context/LibraryContext';
|
||||
import { useConceptNavigation } from '@/context/NagivationContext';
|
||||
import { useConceptNavigation } from '@/context/NavigationContext';
|
||||
import { ILibraryItem } from '@/models/library';
|
||||
import { IRSFormCreateData } from '@/models/rsform';
|
||||
import { classnames } from '@/utils/constants';
|
||||
|
|
|
@ -9,7 +9,7 @@ import Modal, { ModalProps } from '@/components/Common/Modal';
|
|||
import Overlay from '@/components/Common/Overlay';
|
||||
import HelpButton from '@/components/Help/HelpButton';
|
||||
import usePartialUpdate from '@/hooks/usePartialUpdate';
|
||||
import { HelpTopic } from '@/models/miscelanious';
|
||||
import { HelpTopic } from '@/models/miscellaneous';
|
||||
import { CstType, ICstCreateData, IRSForm } from '@/models/rsform';
|
||||
import { inferTemplatedType, substituteTemplateArgs } from '@/models/rslangAPI';
|
||||
import { classnames } from '@/utils/constants';
|
||||
|
|
|
@ -9,7 +9,7 @@ import Modal from '@/components/Common/Modal';
|
|||
import Overlay from '@/components/Common/Overlay';
|
||||
import HelpButton from '@/components/Help/HelpButton';
|
||||
import { ReferenceType } from '@/models/language';
|
||||
import { HelpTopic } from '@/models/miscelanious';
|
||||
import { HelpTopic } from '@/models/miscellaneous';
|
||||
import { IConstituenta } from '@/models/rsform';
|
||||
import { labelReferenceType } from '@/utils/labels';
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import ConstituentaPicker from '@/components/Shared/ConstituentaPicker';
|
|||
import SelectGrammeme from '@/components/Shared/SelectGrammeme';
|
||||
import { ReferenceType } from '@/models/language';
|
||||
import { parseEntityReference, parseGrammemes } from '@/models/languageAPI';
|
||||
import { CstMatchMode } from '@/models/miscelanious';
|
||||
import { CstMatchMode } from '@/models/miscellaneous';
|
||||
import { IConstituenta } from '@/models/rsform';
|
||||
import { matchConstituenta } from '@/models/rsformAPI';
|
||||
import { prefixes } from '@/utils/constants';
|
||||
|
|
|
@ -14,7 +14,7 @@ import SelectGrammeme from '@/components/Shared/SelectGrammeme';
|
|||
import useConceptText from '@/hooks/useConceptText';
|
||||
import { Grammeme, ITextRequest, IWordForm, IWordFormPlain } from '@/models/language';
|
||||
import { parseGrammemes, wordFormEquals } from '@/models/languageAPI';
|
||||
import { HelpTopic } from '@/models/miscelanious';
|
||||
import { HelpTopic } from '@/models/miscellaneous';
|
||||
import { IConstituenta, TermForm } from '@/models/rsform';
|
||||
import { IGrammemeOption, SelectorGrammemesList, SelectorGrammems } from '@/utils/selectors';
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import Checkbox from '@/components/Common/Checkbox';
|
||||
import Modal, { ModalProps } from '@/components/Common/Modal';
|
||||
import usePartialUpdate from '@/hooks/usePartialUpdate';
|
||||
import { GraphFilterParams } from '@/models/miscelanious';
|
||||
import { GraphFilterParams } from '@/models/miscellaneous';
|
||||
import { CstType } from '@/models/rsform';
|
||||
import { labelCstType } from '@/utils/labels';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import Modal, { ModalProps } from '@/components/Common/Modal';
|
|||
import { useConceptTheme } from '@/context/ThemeContext';
|
||||
import { SyntaxTree } from '@/models/rslang';
|
||||
import { graphDarkT, graphLightT } from '@/utils/color';
|
||||
import { colorbgSyntaxTree } from '@/utils/color';
|
||||
import { colorBgSyntaxTree } from '@/utils/color';
|
||||
import { resources } from '@/utils/constants';
|
||||
import { labelSyntaxTree } from '@/utils/labels';
|
||||
|
||||
|
@ -28,7 +28,7 @@ function DlgShowAST({ hideWindow, syntaxTree, expression }: DlgShowASTProps) {
|
|||
() => syntaxTree.map(node => ({
|
||||
id: String(node.uid),
|
||||
label: labelSyntaxTree(node),
|
||||
fill: colorbgSyntaxTree(node, colors),
|
||||
fill: colorBgSyntaxTree(node, colors),
|
||||
})), [syntaxTree, colors]);
|
||||
|
||||
const edges: GraphEdge[] = useMemo(
|
||||
|
|
|
@ -67,7 +67,7 @@ export enum Grammeme {
|
|||
/**
|
||||
* Represents part of speech language concept.
|
||||
*
|
||||
* Implemented as a list of mututally exclusive {@link Grammeme}s.
|
||||
* Implemented as a list of mutually exclusive {@link Grammeme}s.
|
||||
*/
|
||||
export const PartOfSpeech = [
|
||||
Grammeme.NOUN, Grammeme.ADJF, Grammeme.ADJS, Grammeme.COMP,
|
||||
|
@ -79,7 +79,7 @@ export const PartOfSpeech = [
|
|||
/**
|
||||
* Represents gender language concept.
|
||||
*
|
||||
* Implemented as a list of mututally exclusive {@link Grammeme}s.
|
||||
* Implemented as a list of mutually exclusive {@link Grammeme}s.
|
||||
*/
|
||||
export const Gender = [
|
||||
Grammeme.masc, Grammeme.femn, Grammeme.neut
|
||||
|
@ -88,7 +88,7 @@ export const Gender = [
|
|||
/**
|
||||
* Represents case language concept.
|
||||
*
|
||||
* Implemented as a list of mututally exclusive {@link Grammeme}s.
|
||||
* Implemented as a list of mutually exclusive {@link Grammeme}s.
|
||||
*/
|
||||
export const Case = [
|
||||
Grammeme.nomn, Grammeme.gent, Grammeme.datv,
|
||||
|
@ -98,49 +98,49 @@ export const Case = [
|
|||
/**
|
||||
* Represents plurality language concept.
|
||||
*
|
||||
* Implemented as a list of mututally exclusive {@link Grammeme}s.
|
||||
* Implemented as a list of mutually exclusive {@link Grammeme}s.
|
||||
*/
|
||||
export const Plurality = [Grammeme.sing, Grammeme.plur];
|
||||
|
||||
/**
|
||||
* Represents verb perfectivity language concept.
|
||||
*
|
||||
* Implemented as a list of mututally exclusive {@link Grammeme}s.
|
||||
* Implemented as a list of mutually exclusive {@link Grammeme}s.
|
||||
*/
|
||||
export const Perfectivity = [Grammeme.perf, Grammeme.impf];
|
||||
|
||||
/**
|
||||
* Represents verb transitivity language concept.
|
||||
*
|
||||
* Implemented as a list of mututally exclusive {@link Grammeme}s.
|
||||
* Implemented as a list of mutually exclusive {@link Grammeme}s.
|
||||
*/
|
||||
export const Transitivity = [Grammeme.tran, Grammeme.intr];
|
||||
|
||||
/**
|
||||
* Represents verb mood language concept.
|
||||
*
|
||||
* Implemented as a list of mututally exclusive {@link Grammeme}s.
|
||||
* Implemented as a list of mutually exclusive {@link Grammeme}s.
|
||||
*/
|
||||
export const Mood = [Grammeme.indc, Grammeme.impr];
|
||||
|
||||
/**
|
||||
* Represents verb self-inclusion language concept.
|
||||
*
|
||||
* Implemented as a list of mututally exclusive {@link Grammeme}s.
|
||||
* Implemented as a list of mutually exclusive {@link Grammeme}s.
|
||||
*/
|
||||
export const Inclusion = [Grammeme.incl, Grammeme.excl];
|
||||
|
||||
/**
|
||||
* Represents verb voice language concept.
|
||||
*
|
||||
* Implemented as a list of mututally exclusive {@link Grammeme}s.
|
||||
* Implemented as a list of mutually exclusive {@link Grammeme}s.
|
||||
*/
|
||||
export const Voice = [Grammeme.actv, Grammeme.pssv];
|
||||
|
||||
/**
|
||||
* Represents verb tense language concept.
|
||||
*
|
||||
* Implemented as a list of mututally exclusive {@link Grammeme}s.
|
||||
* Implemented as a list of mutually exclusive {@link Grammeme}s.
|
||||
*/
|
||||
export const Tense = [
|
||||
Grammeme.pres,
|
||||
|
@ -151,7 +151,7 @@ export const Tense = [
|
|||
/**
|
||||
* Represents verb person language concept.
|
||||
*
|
||||
* Implemented as a list of mututally exclusive {@link Grammeme}s.
|
||||
* Implemented as a list of mutually exclusive {@link Grammeme}s.
|
||||
*/
|
||||
export const Person = [
|
||||
Grammeme.per1,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
/**
|
||||
* Represents user detailed information.
|
||||
* Some information should only be accesible to authorized users
|
||||
* Some information should only be accessible to authorized users
|
||||
*/
|
||||
export interface IUser {
|
||||
id: number | null
|
||||
|
@ -23,7 +23,7 @@ export interface ICurrentUser extends Pick<IUser, 'id' | 'username' | 'is_staff'
|
|||
}
|
||||
|
||||
/**
|
||||
* Represents login data, used to authentificate users.
|
||||
* Represents login data, used to authenticate users.
|
||||
*/
|
||||
export interface IUserLoginData extends Pick<IUser, 'username'> {
|
||||
password: string
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* Module: Miscellanious frontend model types. Future tagets for refactoring aimed at extracting modules.
|
||||
* Module: Miscellaneous frontend model types. Future targets for refactoring aimed at extracting modules.
|
||||
*/
|
||||
|
||||
/**
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* Module: API for miscellanious frontend model types. Future tagets for refactoring aimed at extracting modules.
|
||||
* Module: API for miscellaneous frontend model types. Future targets for refactoring aimed at extracting modules.
|
||||
*/
|
||||
import { DependencyMode } from './miscelanious';
|
||||
import { DependencyMode } from './miscellaneous';
|
||||
import { IConstituenta, IRSForm } from './rsform';
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ export enum CstType {
|
|||
THEOREM = 'theorem'
|
||||
}
|
||||
|
||||
// CstType constant for category dividers in TemplateSchemas. TODO: create separate sctructure for templates
|
||||
// CstType constant for category dividers in TemplateSchemas. TODO: create separate structure for templates
|
||||
export const CATEGORY_CST_TYPE = CstType.THEOREM;
|
||||
|
||||
/**
|
||||
|
@ -47,7 +47,7 @@ export enum ExpressionStatus {
|
|||
}
|
||||
|
||||
/**
|
||||
* Represents word form for natural languange.
|
||||
* Represents word form for natural language.
|
||||
*/
|
||||
export interface TermForm {
|
||||
text: string
|
||||
|
@ -143,9 +143,9 @@ export interface IRSFormStats {
|
|||
count_all: number
|
||||
count_errors: number
|
||||
count_property: number
|
||||
count_incalc: number
|
||||
count_incalculable: number
|
||||
|
||||
count_termin: number
|
||||
count_text_term: number
|
||||
count_definition: number
|
||||
count_convention: number
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
import { Graph } from '@/utils/Graph';
|
||||
import { TextMatcher } from '@/utils/utils';
|
||||
|
||||
import { CstMatchMode } from './miscelanious';
|
||||
import { CstMatchMode } from './miscellaneous';
|
||||
import {
|
||||
CATEGORY_CST_TYPE, CstClass, CstType,
|
||||
ExpressionStatus, IConstituenta, IRSForm, IRSFormData
|
||||
|
@ -28,9 +28,9 @@ export function loadRSFormData(input: IRSFormData): IRSForm {
|
|||
count_all: 0,
|
||||
count_errors: 0,
|
||||
count_property: 0,
|
||||
count_incalc: 0,
|
||||
count_incalculable: 0,
|
||||
|
||||
count_termin: 0,
|
||||
count_text_term: 0,
|
||||
count_definition: 0,
|
||||
count_convention: 0,
|
||||
|
||||
|
@ -51,11 +51,11 @@ export function loadRSFormData(input: IRSFormData): IRSForm {
|
|||
(sum, cst) => sum + (cst.parse?.status === ParsingStatus.INCORRECT ? 1 : 0) || 0, 0),
|
||||
count_property: result.items.reduce(
|
||||
(sum, cst) => sum + (cst.parse?.valueClass === ValueClass.PROPERTY ? 1 : 0) || 0, 0),
|
||||
count_incalc: result.items.reduce(
|
||||
count_incalculable: result.items.reduce(
|
||||
(sum, cst) => sum +
|
||||
((cst.parse?.status === ParsingStatus.VERIFIED && cst.parse?.valueClass === ValueClass.INVALID) ? 1 : 0) || 0, 0),
|
||||
|
||||
count_termin: result.items.reduce(
|
||||
count_text_term: result.items.reduce(
|
||||
(sum, cst) => (sum + (cst.term_raw ? 1 : 0) || 0), 0),
|
||||
count_definition: result.items.reduce(
|
||||
(sum, cst) => (sum + (cst.definition_raw ? 1 : 0) || 0), 0),
|
||||
|
|
|
@ -206,7 +206,7 @@ export enum TokenID {
|
|||
export enum RSErrorType {
|
||||
unknownSymbol = 33283,
|
||||
syntax = 33792,
|
||||
missingParanthesis = 33798,
|
||||
missingParenthesis = 33798,
|
||||
missingCurlyBrace = 33799,
|
||||
invalidQuantifier = 33800,
|
||||
expectedArgDeclaration = 33812,
|
||||
|
@ -230,10 +230,10 @@ export enum RSErrorType {
|
|||
invalidProjectionTuple = 34833,
|
||||
invalidProjectionSet = 34834,
|
||||
invalidEnumeration = 34835,
|
||||
ivalidBinding = 34836,
|
||||
invalidBinding = 34836,
|
||||
localOutOfScope = 34837,
|
||||
invalidElementPredicat = 34838,
|
||||
invalidArgsArtity = 34840,
|
||||
invalidElementPredicate = 34838,
|
||||
invalidArgsArity = 34840,
|
||||
invalidArgumentType = 34841,
|
||||
invalidEqualsEmpty = 34842,
|
||||
globalStructure = 34844,
|
||||
|
|
|
@ -16,7 +16,7 @@ import TextInput from '@/components/Common/TextInput';
|
|||
import InfoError from '@/components/InfoError';
|
||||
import RequireAuth from '@/components/RequireAuth';
|
||||
import { useLibrary } from '@/context/LibraryContext';
|
||||
import { useConceptNavigation } from '@/context/NagivationContext';
|
||||
import { useConceptNavigation } from '@/context/NavigationContext';
|
||||
import { LibraryItemType } from '@/models/library';
|
||||
import { IRSFormCreateData } from '@/models/rsform';
|
||||
import { classnames, EXTEOR_TRS_FILE, limits, patterns } from '@/utils/constants';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { useLayoutEffect } from 'react';
|
||||
|
||||
import { useAuth } from '@/context/AuthContext';
|
||||
import { useConceptNavigation } from '@/context/NagivationContext';
|
||||
import { useConceptNavigation } from '@/context/NavigationContext';
|
||||
import { TIMEOUT_UI_REFRESH } from '@/utils/constants';
|
||||
|
||||
function HomePage() {
|
||||
|
|
|
@ -6,12 +6,12 @@ import { ConceptLoader } from '@/components/Common/ConceptLoader';
|
|||
import InfoError from '@/components/InfoError';
|
||||
import { useAuth } from '@/context/AuthContext';
|
||||
import { useLibrary } from '@/context/LibraryContext';
|
||||
import { useConceptNavigation } from '@/context/NagivationContext';
|
||||
import { useConceptNavigation } from '@/context/NavigationContext';
|
||||
import { useConceptTheme } from '@/context/ThemeContext';
|
||||
import useLocalStorage from '@/hooks/useLocalStorage';
|
||||
import useQueryStrings from '@/hooks/useQueryStrings';
|
||||
import { ILibraryItem } from '@/models/library';
|
||||
import { ILibraryFilter, LibraryFilterStrategy } from '@/models/miscelanious';
|
||||
import { ILibraryFilter, LibraryFilterStrategy } from '@/models/miscellaneous';
|
||||
|
||||
import SearchPanel from './SearchPanel';
|
||||
import ViewLibrary from './ViewLibrary';
|
||||
|
|
|
@ -8,7 +8,7 @@ import DropdownCheckbox from '@/components/Common/DropdownCheckbox';
|
|||
import SelectorButton from '@/components/Common/SelectorButton';
|
||||
import { useAuth } from '@/context/AuthContext';
|
||||
import useDropdown from '@/hooks/useDropdown';
|
||||
import { LibraryFilterStrategy } from '@/models/miscelanious';
|
||||
import { LibraryFilterStrategy } from '@/models/miscellaneous';
|
||||
import { prefixes } from '@/utils/constants';
|
||||
import { describeLibraryFilter, labelLibraryFilter } from '@/utils/labels';
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@ import clsx from 'clsx';
|
|||
import { useCallback } from 'react';
|
||||
|
||||
import ConceptSearch from '@/components/Common/ConceptSearch';
|
||||
import { useConceptNavigation } from '@/context/NagivationContext';
|
||||
import { ILibraryFilter } from '@/models/miscelanious';
|
||||
import { LibraryFilterStrategy } from '@/models/miscelanious';
|
||||
import { useConceptNavigation } from '@/context/NavigationContext';
|
||||
import { ILibraryFilter } from '@/models/miscellaneous';
|
||||
import { LibraryFilterStrategy } from '@/models/miscellaneous';
|
||||
|
||||
import PickerStrategy from './PickerStrategy';
|
||||
|
||||
|
|
|
@ -8,11 +8,11 @@ import TextURL from '@/components/Common/TextURL';
|
|||
import DataTable, { createColumnHelper } from '@/components/DataTable';
|
||||
import HelpButton from '@/components/Help/HelpButton';
|
||||
import { useAuth } from '@/context/AuthContext';
|
||||
import { useConceptNavigation } from '@/context/NagivationContext';
|
||||
import { useConceptNavigation } from '@/context/NavigationContext';
|
||||
import { useUsers } from '@/context/UsersContext';
|
||||
import useLocalStorage from '@/hooks/useLocalStorage';
|
||||
import { ILibraryItem } from '@/models/library';
|
||||
import { HelpTopic } from '@/models/miscelanious';
|
||||
import { HelpTopic } from '@/models/miscellaneous';
|
||||
|
||||
import ItemIcons from './ItemIcons';
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import TextURL from '@/components/Common/TextURL';
|
|||
import ExpectedAnonymous from '@/components/ExpectedAnonymous';
|
||||
import InfoError, { ErrorData } from '@/components/InfoError';
|
||||
import { useAuth } from '@/context/AuthContext';
|
||||
import { useConceptNavigation } from '@/context/NagivationContext';
|
||||
import { useConceptNavigation } from '@/context/NavigationContext';
|
||||
import useQueryStrings from '@/hooks/useQueryStrings';
|
||||
import { IUserLoginData } from '@/models/library';
|
||||
import { classnames, resources } from '@/utils/constants';
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
'use client';
|
||||
|
||||
import { useConceptNavigation } from '@/context/NagivationContext';
|
||||
import { useConceptNavigation } from '@/context/NavigationContext';
|
||||
import { useConceptTheme } from '@/context/ThemeContext';
|
||||
import useQueryStrings from '@/hooks/useQueryStrings';
|
||||
import { HelpTopic } from '@/models/miscelanious';
|
||||
import { HelpTopic } from '@/models/miscellaneous';
|
||||
|
||||
import TopicsList from './TopicsList';
|
||||
import ViewTopic from './ViewTopic';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import clsx from 'clsx';
|
||||
|
||||
import { HelpTopic } from '@/models/miscelanious';
|
||||
import { HelpTopic } from '@/models/miscellaneous';
|
||||
import { prefixes } from '@/utils/constants';
|
||||
import { describeHelpTopic, labelHelpTopic } from '@/utils/labels';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import InfoTopic from '@/components/Help/InfoTopic';
|
||||
import { HelpTopic } from '@/models/miscelanious';
|
||||
import { HelpTopic } from '@/models/miscellaneous';
|
||||
|
||||
interface ViewTopicProps {
|
||||
topic: HelpTopic
|
||||
|
|
|
@ -7,7 +7,7 @@ import { FiSave } from 'react-icons/fi';
|
|||
import MiniButton from '@/components/Common/MiniButton';
|
||||
import Overlay from '@/components/Common/Overlay';
|
||||
import HelpButton from '@/components/Help/HelpButton';
|
||||
import { HelpTopic } from '@/models/miscelanious';
|
||||
import { HelpTopic } from '@/models/miscellaneous';
|
||||
|
||||
interface ConstituentaToolbarProps {
|
||||
isMutable: boolean
|
||||
|
|
|
@ -13,10 +13,10 @@ import ViewConstituents from '../ViewConstituents';
|
|||
import ConstituentaToolbar from './ConstituentaToolbar';
|
||||
import FormConstituenta from './FormConstituenta';
|
||||
|
||||
// Max height of content for left enditor pane.
|
||||
// Max height of content for left editor pane.
|
||||
const UNFOLDED_HEIGHT = '59.1rem';
|
||||
|
||||
// Thershold window width to hide side constituents list.
|
||||
// Threshold window width to hide side constituents list.
|
||||
const SIDELIST_HIDE_THRESHOLD = 1100; // px
|
||||
|
||||
interface EditorConstituentaProps {
|
||||
|
|
|
@ -63,9 +63,9 @@ function EditorRSExpression({
|
|||
resetParse();
|
||||
}, [activeCst, resetParse, toggleReset]);
|
||||
|
||||
function handleChange(newvalue: string) {
|
||||
onChange(newvalue);
|
||||
setIsModified(newvalue !== activeCst?.definition_formal);
|
||||
function handleChange(newValue: string) {
|
||||
onChange(newValue);
|
||||
setIsModified(newValue !== activeCst?.definition_formal);
|
||||
}
|
||||
|
||||
function handleCheckExpression(callback?: (parse: IExpressionParse) => void) {
|
||||
|
|
|
@ -9,7 +9,7 @@ import { ExpressionStatus } from '@/models/rsform';
|
|||
import { type IConstituenta } from '@/models/rsform';
|
||||
import { inferStatus } from '@/models/rsformAPI';
|
||||
import { IExpressionParse, ParsingStatus } from '@/models/rslang';
|
||||
import { colorbgCstStatus } from '@/utils/color';
|
||||
import { colorBgCstStatus } from '@/utils/color';
|
||||
import { globalIDs } from '@/utils/constants';
|
||||
import { labelExpressionStatus } from '@/utils/labels';
|
||||
|
||||
|
@ -46,7 +46,7 @@ function StatusBar({ isModified, processing, constituenta, parseData, onAnalyze
|
|||
'cursor-pointer',
|
||||
'duration-500 transition-colors'
|
||||
)}
|
||||
style={{backgroundColor: processing ? colors.bgDefault : colorbgCstStatus(status, colors)}}
|
||||
style={{backgroundColor: processing ? colors.bgDefault : colorBgCstStatus(status, colors)}}
|
||||
data-tooltip-id={globalIDs.tooltip}
|
||||
data-tooltip-content='Проверить определение [Ctrl + Q]'
|
||||
onClick={onAnalyze}
|
||||
|
|
|
@ -25,17 +25,17 @@ function RSFormStats({ stats }: RSFormStatsProps) {
|
|||
label='Неразмерных'
|
||||
text={stats.count_property}
|
||||
/> : null}
|
||||
{stats.count_incalc !== 0 ?
|
||||
<LabeledValue id='count_incalc'
|
||||
{stats.count_incalculable !== 0 ?
|
||||
<LabeledValue id='count_incalculable'
|
||||
label='Невычислимых'
|
||||
text={stats.count_incalc}
|
||||
text={stats.count_incalculable}
|
||||
/> : null}
|
||||
|
||||
<Divider margins='my-2' />
|
||||
|
||||
<LabeledValue id='count_termin'
|
||||
<LabeledValue id='count_text_term'
|
||||
label='Термины'
|
||||
text={stats.count_termin}
|
||||
text={stats.count_text_term}
|
||||
/>
|
||||
<LabeledValue id='count_definition'
|
||||
label='Определения'
|
||||
|
|
|
@ -8,7 +8,7 @@ import { LuCrown } from 'react-icons/lu';
|
|||
import MiniButton from '@/components/Common/MiniButton';
|
||||
import Overlay from '@/components/Common/Overlay';
|
||||
import HelpButton from '@/components/Help/HelpButton';
|
||||
import { HelpTopic } from '@/models/miscelanious';
|
||||
import { HelpTopic } from '@/models/miscellaneous';
|
||||
|
||||
interface RSFormToolbarProps {
|
||||
isMutable: boolean
|
||||
|
|
|
@ -12,7 +12,7 @@ import MiniButton from '@/components/Common/MiniButton';
|
|||
import Overlay from '@/components/Common/Overlay';
|
||||
import HelpButton from '@/components/Help/HelpButton';
|
||||
import useDropdown from '@/hooks/useDropdown';
|
||||
import { HelpTopic } from '@/models/miscelanious';
|
||||
import { HelpTopic } from '@/models/miscellaneous';
|
||||
import { CstType } from '@/models/rsform';
|
||||
import { prefixes } from '@/utils/constants';
|
||||
import { labelCstType } from '@/utils/labels';
|
||||
|
|
|
@ -12,9 +12,9 @@ import { useRSForm } from '@/context/RSFormContext';
|
|||
import { useConceptTheme } from '@/context/ThemeContext';
|
||||
import DlgGraphParams from '@/dialogs/DlgGraphParams';
|
||||
import useLocalStorage from '@/hooks/useLocalStorage';
|
||||
import { GraphColoringScheme, GraphFilterParams } from '@/models/miscelanious';
|
||||
import { GraphColoringScheme, GraphFilterParams } from '@/models/miscellaneous';
|
||||
import { CstType, ICstCreateData } from '@/models/rsform';
|
||||
import { colorbgGraphNode } from '@/utils/color';
|
||||
import { colorBgGraphNode } from '@/utils/color';
|
||||
import { classnames, TIMEOUT_GRAPH_REFRESH } from '@/utils/constants';
|
||||
|
||||
import GraphSidebar from './GraphSidebar';
|
||||
|
@ -103,7 +103,7 @@ function EditorTermGraph({ isMutable, onOpenEdit, onCreateCst, onDeleteCst }: Ed
|
|||
if (cst) {
|
||||
result.push({
|
||||
id: String(node.id),
|
||||
fill: colorbgGraphNode(cst, coloringScheme, colors),
|
||||
fill: colorBgGraphNode(cst, coloringScheme, colors),
|
||||
label: cst.term_resolved && !filterParams.noText ? `${cst.alias}: ${cst.term_resolved}` : cst.alias
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { LayoutTypes } from 'reagraph';
|
||||
|
||||
import SelectSingle from '@/components/Common/SelectSingle';
|
||||
import { GraphColoringScheme } from '@/models/miscelanious';
|
||||
import { mapLabelColoring, mapLableLayout } from '@/utils/labels';
|
||||
import { GraphColoringScheme } from '@/models/miscellaneous';
|
||||
import { mapLabelColoring, mapLabelLayout } from '@/utils/labels';
|
||||
import { SelectorGraphColoring, SelectorGraphLayout } from '@/utils/selectors';
|
||||
|
||||
interface GraphSidebarProps {
|
||||
|
@ -30,7 +30,7 @@ function GraphSidebar({
|
|||
placeholder='Способ расположения'
|
||||
options={SelectorGraphLayout}
|
||||
isSearchable={false}
|
||||
value={layout ? { value: layout, label: mapLableLayout.get(layout) } : null}
|
||||
value={layout ? { value: layout, label: mapLabelLayout.get(layout) } : null}
|
||||
onChange={data => setLayout(data?.value ?? SelectorGraphLayout[0].value)}
|
||||
/>
|
||||
</div>);
|
||||
|
|
|
@ -5,7 +5,7 @@ import { BiCollapse, BiFilterAlt, BiFont, BiFontFamily, BiPlanet, BiPlusCircle,
|
|||
import MiniButton from '@/components/Common/MiniButton';
|
||||
import Overlay from '@/components/Common/Overlay';
|
||||
import HelpButton from '@/components/Help/HelpButton';
|
||||
import { HelpTopic } from '@/models/miscelanious';
|
||||
import { HelpTopic } from '@/models/miscellaneous';
|
||||
|
||||
interface GraphToolbarProps {
|
||||
isMutable: boolean
|
||||
|
|
|
@ -4,9 +4,9 @@ import { useCallback, useMemo } from 'react';
|
|||
|
||||
import ConstituentaTooltip from '@/components/Help/ConstituentaTooltip';
|
||||
import { useConceptTheme } from '@/context/ThemeContext';
|
||||
import { GraphColoringScheme } from '@/models/miscelanious';
|
||||
import { GraphColoringScheme } from '@/models/miscellaneous';
|
||||
import { IRSForm } from '@/models/rsform';
|
||||
import { colorbgGraphNode } from '@/utils/color';
|
||||
import { colorBgGraphNode } from '@/utils/color';
|
||||
import { prefixes } from '@/utils/constants';
|
||||
|
||||
interface ViewHiddenProps {
|
||||
|
@ -56,7 +56,7 @@ function ViewHidden({
|
|||
<div key={id} id={id}
|
||||
className='min-w-[3rem] rounded-md text-center cursor-pointer select-none'
|
||||
style={{
|
||||
backgroundColor: colorbgGraphNode(cst, adjustedColoring, colors),
|
||||
backgroundColor: colorBgGraphNode(cst, adjustedColoring, colors),
|
||||
...dismissedStyle(cstID)
|
||||
}}
|
||||
onClick={() => toggleSelection(cstID)}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { useLayoutEffect, useMemo, useState } from 'react';
|
||||
|
||||
import { GraphFilterParams } from '@/models/miscelanious';
|
||||
import { GraphFilterParams } from '@/models/miscellaneous';
|
||||
import { CstType, IRSForm } from '@/models/rsform';
|
||||
import { Graph } from '@/utils/Graph';
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import InfoError, { ErrorData } from '@/components/InfoError';
|
|||
import { useAccessMode } from '@/context/AccessModeContext';
|
||||
import { useAuth } from '@/context/AuthContext';
|
||||
import { useLibrary } from '@/context/LibraryContext';
|
||||
import { useBlockNavigation, useConceptNavigation } from '@/context/NagivationContext';
|
||||
import { useBlockNavigation, useConceptNavigation } from '@/context/NavigationContext';
|
||||
import { useRSForm } from '@/context/RSFormContext';
|
||||
import { useConceptTheme } from '@/context/ThemeContext';
|
||||
import DlgCloneLibraryItem from '@/dialogs/DlgCloneLibraryItem';
|
||||
|
@ -26,7 +26,7 @@ import DlgEditWordForms from '@/dialogs/DlgEditWordForms';
|
|||
import DlgRenameCst from '@/dialogs/DlgRenameCst';
|
||||
import DlgUploadRSForm from '@/dialogs/DlgUploadRSForm';
|
||||
import useQueryStrings from '@/hooks/useQueryStrings';
|
||||
import { UserAccessMode } from '@/models/miscelanious';
|
||||
import { UserAccessMode } from '@/models/miscellaneous';
|
||||
import { IConstituenta, ICstCreateData, ICstRenameData, ICstUpdateData, TermForm } from '@/models/rsform';
|
||||
import { EXTEOR_TRS_FILE, prefixes, TIMEOUT_UI_REFRESH } from '@/utils/constants';
|
||||
import { createAliasFor } from '@/utils/misc';
|
||||
|
|
|
@ -9,10 +9,10 @@ import Dropdown from '@/components/Common/Dropdown';
|
|||
import DropdownButton from '@/components/Common/DropdownButton';
|
||||
import { useAccessMode } from '@/context/AccessModeContext';
|
||||
import { useAuth } from '@/context/AuthContext';
|
||||
import { useConceptNavigation } from '@/context/NagivationContext';
|
||||
import { useConceptNavigation } from '@/context/NavigationContext';
|
||||
import { useRSForm } from '@/context/RSFormContext';
|
||||
import useDropdown from '@/hooks/useDropdown';
|
||||
import { UserAccessMode } from '@/models/miscelanious';
|
||||
import { UserAccessMode } from '@/models/miscellaneous';
|
||||
import { describeAccessMode, labelAccessMode } from '@/utils/labels';
|
||||
|
||||
interface RSTabsMenuProps {
|
||||
|
|
|
@ -9,13 +9,13 @@ import DropdownButton from '@/components/Common/DropdownButton';
|
|||
import SelectorButton from '@/components/Common/SelectorButton';
|
||||
import useDropdown from '@/hooks/useDropdown';
|
||||
import useLocalStorage from '@/hooks/useLocalStorage';
|
||||
import { CstMatchMode, DependencyMode } from '@/models/miscelanious';
|
||||
import { applyGraphFilter } from '@/models/miscelaniousAPI';
|
||||
import { CstMatchMode, DependencyMode } from '@/models/miscellaneous';
|
||||
import { applyGraphFilter } from '@/models/miscellaneousAPI';
|
||||
import { IConstituenta, IRSForm } from '@/models/rsform';
|
||||
import { createMockConstituenta, matchConstituenta } from '@/models/rsformAPI';
|
||||
import { extractGlobals } from '@/models/rslangAPI';
|
||||
import { prefixes } from '@/utils/constants';
|
||||
import { describeCstMathchMode, describeCstSource, labelCstMathchMode, labelCstSource } from '@/utils/labels';
|
||||
import { describeCstMatchMode, describeCstSource, labelCstMatchMode, labelCstSource } from '@/utils/labels';
|
||||
|
||||
interface ConstituentsSearchProps {
|
||||
schema?: IRSForm
|
||||
|
@ -87,7 +87,7 @@ function ConstituentsSearch({ schema, activeID, activeExpression, setFiltered }:
|
|||
title='Настройка атрибутов для фильтрации'
|
||||
className='h-full'
|
||||
icon={<BiFilterAlt size='1.25rem' />}
|
||||
text={labelCstMathchMode(filterMatch)}
|
||||
text={labelCstMatchMode(filterMatch)}
|
||||
onClick={matchModeMenu.toggle}
|
||||
/>
|
||||
<Dropdown stretchLeft isOpen={matchModeMenu.isOpen}>
|
||||
|
@ -99,7 +99,7 @@ function ConstituentsSearch({ schema, activeID, activeExpression, setFiltered }:
|
|||
key={`${prefixes.cst_match_mode_list}${index}`}
|
||||
onClick={() => handleMatchModeChange(matchMode)}
|
||||
>
|
||||
<p><b>{labelCstMathchMode(matchMode)}:</b> {describeCstMathchMode(matchMode)}</p>
|
||||
<p><b>{labelCstMatchMode(matchMode)}:</b> {describeCstMatchMode(matchMode)}</p>
|
||||
</DropdownButton>);
|
||||
})}
|
||||
</Dropdown>
|
||||
|
|
|
@ -63,7 +63,7 @@ function ConstituentsTable({
|
|||
<ConstituentaBadge
|
||||
theme={colors}
|
||||
value={props.row.original}
|
||||
prefixID={prefixes.cst_sidetable}
|
||||
prefixID={prefixes.cst_side_table}
|
||||
/>
|
||||
}),
|
||||
columnHelper.accessor(cst => describeConstituenta(cst), {
|
||||
|
|
|
@ -10,7 +10,7 @@ import { animateSideView } from '@/utils/animations';
|
|||
import ConstituentsSearch from './ConstituentsSearch';
|
||||
import ConstituentsTable from './ConstituentsTable';
|
||||
|
||||
// Height that should be left to accomodate navigation panel + bottom margin
|
||||
// Height that should be left to accommodate navigation panel + bottom margin
|
||||
const LOCAL_NAVIGATION_H = '2.1rem';
|
||||
|
||||
// Window width cutoff for expression show
|
||||
|
|
|
@ -16,7 +16,7 @@ import TextURL from '@/components/Common/TextURL';
|
|||
import ExpectedAnonymous from '@/components/ExpectedAnonymous';
|
||||
import InfoError from '@/components/InfoError';
|
||||
import { useAuth } from '@/context/AuthContext';
|
||||
import { useConceptNavigation } from '@/context/NagivationContext';
|
||||
import { useConceptNavigation } from '@/context/NavigationContext';
|
||||
import { type IUserSignupData } from '@/models/library';
|
||||
import { classnames, globalIDs, patterns } from '@/utils/constants';
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ function RestorePasswordPage() {
|
|||
return (
|
||||
<div className='py-3'>
|
||||
<p>Автоматическое восстановление пароля не доступно.</p>
|
||||
<p>Возможно восстановление пароля через обращение на <TextURL href={urls.mailportal} text='portal@acconcept.ru'/></p>
|
||||
<p>Возможно восстановление пароля через обращение на <TextURL href={urls.mail_portal} text='portal@acconcept.ru'/></p>
|
||||
</div>);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import SubmitButton from '@/components/Common/SubmitButton';
|
|||
import TextInput from '@/components/Common/TextInput';
|
||||
import InfoError, { ErrorData } from '@/components/InfoError';
|
||||
import { useAuth } from '@/context/AuthContext';
|
||||
import { useConceptNavigation } from '@/context/NagivationContext';
|
||||
import { useConceptNavigation } from '@/context/NavigationContext';
|
||||
import { IUserUpdatePassword } from '@/models/library';
|
||||
|
||||
function ProcessError({error}: {error: ErrorData}): React.ReactElement {
|
||||
|
|
|
@ -6,7 +6,7 @@ import { toast } from 'react-toastify';
|
|||
|
||||
import SubmitButton from '@/components/Common/SubmitButton';
|
||||
import TextInput from '@/components/Common/TextInput';
|
||||
import { useBlockNavigation } from '@/context/NagivationContext';
|
||||
import { useBlockNavigation } from '@/context/NavigationContext';
|
||||
import { useUserProfile } from '@/context/UserProfileContext';
|
||||
import { IUserUpdateData } from '@/models/library';
|
||||
import { classnames } from '@/utils/constants';
|
||||
|
|
|
@ -37,7 +37,7 @@ function UserTabs() {
|
|||
<div>
|
||||
<Overlay position='top-0 right-0'>
|
||||
<MiniButton
|
||||
title='Показать/Скрыть список отслеживаний'
|
||||
title='Показать/Скрыть отслеживаемые схемы'
|
||||
icon={showSubs
|
||||
? <FiBell size='1.25rem' className='clr-text-primary' />
|
||||
: <FiBellOff size='1.25rem' className='clr-text-primary' />
|
||||
|
|
|
@ -5,7 +5,7 @@ import { useMemo } from 'react';
|
|||
import { useIntl } from 'react-intl';
|
||||
|
||||
import DataTable, { createColumnHelper } from '@/components/DataTable';
|
||||
import { useConceptNavigation } from '@/context/NagivationContext';
|
||||
import { useConceptNavigation } from '@/context/NavigationContext';
|
||||
import { ILibraryItem } from '@/models/library';
|
||||
import { animateSideView } from '@/utils/animations';
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Graph } from './Graph';
|
||||
|
||||
describe('Testing Graph constuction', () => {
|
||||
describe('Testing Graph construction', () => {
|
||||
test('empty Graph should be empty', () => {
|
||||
const graph = new Graph();
|
||||
expect(graph.nodes.size).toBe(0);
|
||||
|
|
|
@ -10,7 +10,7 @@ import { IEntityReference, ISyntacticReference } from '@/models/language';
|
|||
import { parseGrammemes } from '@/models/languageAPI';
|
||||
import { IConstituenta } from '@/models/rsform';
|
||||
|
||||
import { colorfgGrammeme,IColorTheme } from './color';
|
||||
import { colorFgGrammeme,IColorTheme } from './color';
|
||||
import { describeConstituentaTerm, labelCstTypification, labelGrammeme } from './labels';
|
||||
|
||||
/**
|
||||
|
@ -210,8 +210,8 @@ export function domTooltipEntityReference(ref: IEntityReference, cst: IConstitue
|
|||
'text-sm text-center whitespace-nowrap'
|
||||
);
|
||||
gram.style.borderWidth = '1px';
|
||||
gram.style.borderColor = colorfgGrammeme(gramStr, colors);
|
||||
gram.style.color = colorfgGrammeme(gramStr, colors);
|
||||
gram.style.borderColor = colorFgGrammeme(gramStr, colors);
|
||||
gram.style.color = colorFgGrammeme(gramStr, colors);
|
||||
gram.style.fontWeight = '600';
|
||||
gram.style.backgroundColor = colors.bgInput;
|
||||
gram.innerText = labelGrammeme(gramStr);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
|
||||
import { GramData, Grammeme, NounGrams, PartOfSpeech, VerbGrams } from '@/models/language';
|
||||
import { GraphColoringScheme } from '@/models/miscelanious';
|
||||
import { GraphColoringScheme } from '@/models/miscellaneous';
|
||||
import { CstClass, ExpressionStatus, IConstituenta } from '@/models/rsform';
|
||||
import { ISyntaxTreeNode, TokenID } from '@/models/rslang';
|
||||
|
||||
|
@ -301,7 +301,7 @@ export const bracketsDarkT = {
|
|||
/**
|
||||
* Determines background color for {@link ISyntaxTreeNode} based on its type.
|
||||
*/
|
||||
export function colorbgSyntaxTree(node: ISyntaxTreeNode, colors: IColorTheme): string {
|
||||
export function colorBgSyntaxTree(node: ISyntaxTreeNode, colors: IColorTheme): string {
|
||||
switch (node.typeID) {
|
||||
case TokenID.PUNC_DEFINE:
|
||||
case TokenID.PUNC_STRUCT:
|
||||
|
@ -383,7 +383,7 @@ export function colorbgSyntaxTree(node: ISyntaxTreeNode, colors: IColorTheme): s
|
|||
/**
|
||||
* Determines background color for {@link ExpressionStatus}.
|
||||
*/
|
||||
export function colorbgCstStatus(status: ExpressionStatus, colors: IColorTheme): string {
|
||||
export function colorBgCstStatus(status: ExpressionStatus, colors: IColorTheme): string {
|
||||
switch (status) {
|
||||
case ExpressionStatus.VERIFIED: return colors.bgGreen;
|
||||
case ExpressionStatus.INCORRECT: return colors.bgRed;
|
||||
|
@ -397,7 +397,7 @@ export function colorbgCstStatus(status: ExpressionStatus, colors: IColorTheme):
|
|||
/**
|
||||
* Determines foreground color for {@link ExpressionStatus}.
|
||||
*/
|
||||
export function colorfgCstStatus(status: ExpressionStatus, colors: IColorTheme): string {
|
||||
export function colorFgCstStatus(status: ExpressionStatus, colors: IColorTheme): string {
|
||||
switch (status) {
|
||||
case ExpressionStatus.VERIFIED: return colors.fgGreen;
|
||||
case ExpressionStatus.INCORRECT: return colors.fgRed;
|
||||
|
@ -411,7 +411,7 @@ export function colorfgCstStatus(status: ExpressionStatus, colors: IColorTheme):
|
|||
/**
|
||||
* Determines background color for {@link IConstituenta} depending on its {@link CstClass}.
|
||||
*/
|
||||
export function colorbgCstClass(cstClass: CstClass, colors: IColorTheme): string {
|
||||
export function colorBgCstClass(cstClass: CstClass, colors: IColorTheme): string {
|
||||
switch (cstClass) {
|
||||
case CstClass.BASIC: return colors.bgGreen;
|
||||
case CstClass.DERIVED: return colors.bgBlue;
|
||||
|
@ -423,7 +423,7 @@ export function colorbgCstClass(cstClass: CstClass, colors: IColorTheme): string
|
|||
/**
|
||||
* Determines background color for {@link GramData}.
|
||||
*/
|
||||
export function colorbgGrammeme(gram: GramData, colors: IColorTheme): string {
|
||||
export function colorBgGrammeme(gram: GramData, colors: IColorTheme): string {
|
||||
if (PartOfSpeech.includes(gram as Grammeme)) {
|
||||
return colors.bgBlue;
|
||||
}
|
||||
|
@ -439,7 +439,7 @@ export function colorbgGrammeme(gram: GramData, colors: IColorTheme): string {
|
|||
/**
|
||||
* Determines foreground color for {@link GramData}.
|
||||
*/
|
||||
export function colorfgGrammeme(gram: GramData, colors: IColorTheme): string {
|
||||
export function colorFgGrammeme(gram: GramData, colors: IColorTheme): string {
|
||||
if (PartOfSpeech.includes(gram as Grammeme)) {
|
||||
return colors.fgBlue;
|
||||
}
|
||||
|
@ -459,12 +459,12 @@ export function colorfgGrammeme(gram: GramData, colors: IColorTheme): string {
|
|||
/**
|
||||
* Determines graph color for {@link IConstituenta}.
|
||||
*/
|
||||
export function colorbgGraphNode(cst: IConstituenta, coloringScheme: GraphColoringScheme, colors: IColorTheme): string {
|
||||
export function colorBgGraphNode(cst: IConstituenta, coloringScheme: GraphColoringScheme, colors: IColorTheme): string {
|
||||
if (coloringScheme === 'type') {
|
||||
return colorbgCstClass(cst.cst_class, colors);
|
||||
return colorBgCstClass(cst.cst_class, colors);
|
||||
}
|
||||
if (coloringScheme === 'status') {
|
||||
return colorbgCstStatus(cst.status, colors);
|
||||
return colorBgCstStatus(cst.status, colors);
|
||||
}
|
||||
return '';
|
||||
}
|
|
@ -56,7 +56,7 @@ export const youtube = {
|
|||
};
|
||||
|
||||
/**
|
||||
* Classname combinations.
|
||||
* Tailwind CSS combinations.
|
||||
* Note: using clsx in conjunction with tailwindCss is preferred to creating custom CSS
|
||||
*/
|
||||
export const classnames = {
|
||||
|
@ -74,9 +74,9 @@ export const urls = {
|
|||
intro_video: 'https://www.youtube.com/watch?v=0Ty9mu9sOJo',
|
||||
full_course: 'https://www.youtube.com/playlist?list=PLGe_JiAwpqu1C70ruQmCm_OWTWU3KJwDo',
|
||||
|
||||
gitrepo: 'https://github.com/IRBorisov/ConceptPortal',
|
||||
mailportal: 'mailto:portal@acconcept.ru',
|
||||
restapi: 'https://api.portal.acconcept.ru'
|
||||
git_repo: 'https://github.com/IRBorisov/ConceptPortal',
|
||||
mail_portal: 'mailto:portal@acconcept.ru',
|
||||
restAPI: 'https://api.portal.acconcept.ru'
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -96,7 +96,7 @@ export const globalIDs = {
|
|||
export const prefixes = {
|
||||
page_size: 'page-size-',
|
||||
cst_list: 'cst-list-',
|
||||
cst_sidetable: 'cst-sidetable-',
|
||||
cst_side_table: 'cst-side-table-',
|
||||
cst_hidden_list: 'cst-hidden-list-',
|
||||
cst_modal_list: 'cst-modal-list-',
|
||||
cst_template_ist: 'cst-template-list-',
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
* Description is a long description used in tooltips.
|
||||
*/
|
||||
import { GramData,Grammeme, ReferenceType } from '@/models/language';
|
||||
import { CstMatchMode, DependencyMode, HelpTopic, LibraryFilterStrategy, UserAccessMode } from '@/models/miscelanious';
|
||||
import { CstMatchMode, DependencyMode, HelpTopic, LibraryFilterStrategy, UserAccessMode } from '@/models/miscellaneous';
|
||||
import { CstClass, CstType, ExpressionStatus, IConstituenta } from '@/models/rsform';
|
||||
import { IArgumentInfo, IRSErrorDescription, ISyntaxTreeNode, ParsingStatus, RSErrorType, TokenID } from '@/models/rslang';
|
||||
|
||||
/**
|
||||
* Generates desription for {@link IConstituenta}.
|
||||
* Generates description for {@link IConstituenta}.
|
||||
*/
|
||||
export function describeConstituenta(cst: IConstituenta): string {
|
||||
if (cst.cst_type === CstType.STRUCTURED) {
|
||||
|
@ -31,7 +31,7 @@ export function describeConstituenta(cst: IConstituenta): string {
|
|||
}
|
||||
|
||||
/**
|
||||
* Generates desription for term of a given {@link IConstituenta}.
|
||||
* Generates description for term of a given {@link IConstituenta}.
|
||||
*/
|
||||
export function describeConstituentaTerm(cst?: IConstituenta): string {
|
||||
if (!cst) {
|
||||
|
@ -145,7 +145,7 @@ export function describeToken(id: TokenID): string {
|
|||
/**
|
||||
* Retrieves label for {@link CstMatchMode}.
|
||||
*/
|
||||
export function labelCstMathchMode(mode: CstMatchMode): string {
|
||||
export function labelCstMatchMode(mode: CstMatchMode): string {
|
||||
switch (mode) {
|
||||
case CstMatchMode.ALL: return 'общий';
|
||||
case CstMatchMode.EXPR: return 'выражение';
|
||||
|
@ -158,7 +158,7 @@ export function labelCstMathchMode(mode: CstMatchMode): string {
|
|||
/**
|
||||
* Retrieves description for {@link CstMatchMode}.
|
||||
*/
|
||||
export function describeCstMathchMode(mode: CstMatchMode): string {
|
||||
export function describeCstMatchMode(mode: CstMatchMode): string {
|
||||
switch (mode) {
|
||||
case CstMatchMode.ALL: return 'искать во всех атрибутах';
|
||||
case CstMatchMode.EXPR: return 'искать в формальных выражениях';
|
||||
|
@ -190,7 +190,7 @@ export function describeCstSource(mode: DependencyMode): string {
|
|||
case DependencyMode.ALL: return 'все конституенты';
|
||||
case DependencyMode.EXPRESSION: return 'идентификаторы из выражения';
|
||||
case DependencyMode.OUTPUTS: return 'прямые ссылки на текущую';
|
||||
case DependencyMode.INPUTS: return 'пярмые ссылки из текущей';
|
||||
case DependencyMode.INPUTS: return 'прямые ссылки из текущей';
|
||||
case DependencyMode.EXPAND_OUTPUTS: return 'опосредованные ссылки на текущую';
|
||||
case DependencyMode.EXPAND_INPUTS: return 'опосредованные ссылки из текущей';
|
||||
}
|
||||
|
@ -218,16 +218,16 @@ export function describeLibraryFilter(strategy: LibraryFilterStrategy): string {
|
|||
case LibraryFilterStrategy.MANUAL: return 'Отображать все схемы';
|
||||
case LibraryFilterStrategy.COMMON: return 'Отображать общедоступные схемы';
|
||||
case LibraryFilterStrategy.CANONICAL: return 'Отображать стандартные схемы';
|
||||
case LibraryFilterStrategy.PERSONAL: return 'Отображать подписки и владеемые схемы';
|
||||
case LibraryFilterStrategy.PERSONAL: return 'Отображать подписки и собственные схемы';
|
||||
case LibraryFilterStrategy.SUBSCRIBE: return 'Отображать подписки';
|
||||
case LibraryFilterStrategy.OWNED: return 'Отображать владеемые схемы';
|
||||
case LibraryFilterStrategy.OWNED: return 'Отображать собственные схемы';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves label for graph layout mode.
|
||||
*/
|
||||
export const mapLableLayout: Map<string, string> =
|
||||
export const mapLabelLayout: Map<string, string> =
|
||||
new Map([
|
||||
['forceatlas2', 'Граф: Атлас 2D'],
|
||||
['forceDirected2d', 'Граф: Силы 2D'],
|
||||
|
@ -263,7 +263,7 @@ export function labelExpressionStatus(status: ExpressionStatus): string {
|
|||
case ExpressionStatus.INCORRECT: return 'ошибка';
|
||||
case ExpressionStatus.INCALCULABLE: return 'невычислимо';
|
||||
case ExpressionStatus.PROPERTY: return 'неразмерное';
|
||||
case ExpressionStatus.UNKNOWN: return 'непроверено';
|
||||
case ExpressionStatus.UNKNOWN: return 'не проверено';
|
||||
case ExpressionStatus.UNDEFINED: return 'N/A';
|
||||
}
|
||||
}
|
||||
|
@ -310,7 +310,7 @@ export function describeHelpTopic(topic: HelpTopic): string {
|
|||
case HelpTopic.MAIN: return 'Общая справка по порталу';
|
||||
case HelpTopic.LIBRARY: return 'Описание работы с библиотекой схем';
|
||||
case HelpTopic.RSFORM: return 'Описание работы с описанием схемы';
|
||||
case HelpTopic.CSTLIST: return 'Описание работы со списком конституентт';
|
||||
case HelpTopic.CSTLIST: return 'Описание работы со списком конституент';
|
||||
case HelpTopic.CONSTITUENTA: return 'Описание редактирования конституенты';
|
||||
case HelpTopic.GRAPH_TERM: return 'Описание работы с графом термов схемы';
|
||||
case HelpTopic.RSTEMPLATES: return 'Описание работы с Банком выражений>';
|
||||
|
@ -325,8 +325,8 @@ export function describeHelpTopic(topic: HelpTopic): string {
|
|||
/**
|
||||
* Retrieves label for {@link CstType}.
|
||||
*/
|
||||
export function labelCstType(type: CstType): string {
|
||||
switch (type) {
|
||||
export function labelCstType(target: CstType): string {
|
||||
switch (target) {
|
||||
case CstType.BASE: return 'Базисное множество';
|
||||
case CstType.CONSTANT: return 'Константное множество';
|
||||
case CstType.STRUCTURED: return 'Родовая структура';
|
||||
|
@ -341,8 +341,8 @@ export function labelCstType(type: CstType): string {
|
|||
/**
|
||||
* Retrieves label for {@link ReferenceType}.
|
||||
*/
|
||||
export function labelReferenceType(type: ReferenceType): string {
|
||||
switch(type) {
|
||||
export function labelReferenceType(target: ReferenceType): string {
|
||||
switch(target) {
|
||||
case ReferenceType.ENTITY: return 'Использование термина';
|
||||
case ReferenceType.SYNTACTIC: return 'Связывание слов';
|
||||
}
|
||||
|
@ -351,8 +351,8 @@ export function labelReferenceType(type: ReferenceType): string {
|
|||
/**
|
||||
* Retrieves label for {@link CstClass}.
|
||||
*/
|
||||
export function labelCstClass(cclass: CstClass): string {
|
||||
switch (cclass) {
|
||||
export function labelCstClass(target: CstClass): string {
|
||||
switch (target) {
|
||||
case CstClass.BASIC: return 'базовый';
|
||||
case CstClass.DERIVED: return 'производный';
|
||||
case CstClass.STATEMENT: return 'утверждение';
|
||||
|
@ -363,8 +363,8 @@ export function labelCstClass(cclass: CstClass): string {
|
|||
/**
|
||||
* Retrieves description for {@link CstClass}.
|
||||
*/
|
||||
export function describeCstClass(cclass: CstClass): string {
|
||||
switch (cclass) {
|
||||
export function describeCstClass(target: CstClass): string {
|
||||
switch (target) {
|
||||
case CstClass.BASIC: return 'неопределяемое понятие, требует конвенции';
|
||||
case CstClass.DERIVED: return 'выводимое понятие, задаваемое определением';
|
||||
case CstClass.STATEMENT: return 'утверждение формальной логики';
|
||||
|
@ -562,7 +562,7 @@ export function describeRSError(error: IRSErrorDescription): string {
|
|||
return `Неизвестный символ: ${error.params[0]}`;
|
||||
case RSErrorType.syntax:
|
||||
return 'Неопределенная синтаксическая ошибка';
|
||||
case RSErrorType.missingParanthesis:
|
||||
case RSErrorType.missingParenthesis:
|
||||
return 'Некорректная конструкция языка родов структур, проверьте структуру выражения';
|
||||
case RSErrorType.missingCurlyBrace:
|
||||
return "Пропущен символ '}'";
|
||||
|
@ -608,13 +608,13 @@ export function describeRSError(error: IRSErrorDescription): string {
|
|||
return `τ(Pri(a)) = ℬ𝒞i𝔇τ(a). Некорректная типизация аргумента: ${error.params[0]}`;
|
||||
case RSErrorType.invalidEnumeration:
|
||||
return `Типизация аргументов перечисления не совпадает: ${error.params[0]} != ${error.params[1]}`;
|
||||
case RSErrorType.ivalidBinding:
|
||||
case RSErrorType.invalidBinding:
|
||||
return `Количество переменных в кортеже не соответствует размерности декартова произведения`;
|
||||
case RSErrorType.localOutOfScope:
|
||||
return `Использование имени переменной вне области действия: ${error.params[0]}`;
|
||||
case RSErrorType.invalidElementPredicat:
|
||||
case RSErrorType.invalidElementPredicate:
|
||||
return `Несоответствие типизаций операндов для оператора: ${error.params[0]}${error.params[1]}${error.params[2]}`;
|
||||
case RSErrorType.invalidArgsArtity:
|
||||
case RSErrorType.invalidArgsArity:
|
||||
return `Неверное число аргументов терм-функции: ${error.params[0]} != ${error.params[1]}`;
|
||||
case RSErrorType.invalidArgumentType:
|
||||
return `Типизация аргумента терм-функции не соответствует объявленной: ${error.params[0]} != ${error.params[1]}`;
|
||||
|
|
|
@ -5,7 +5,7 @@ import { LayoutTypes } from 'reagraph';
|
|||
|
||||
import { type GramData, Grammeme, ReferenceType } from '@/models/language';
|
||||
import { grammemeCompare } from '@/models/languageAPI';
|
||||
import { GraphColoringScheme } from '@/models/miscelanious';
|
||||
import { GraphColoringScheme } from '@/models/miscellaneous';
|
||||
import { CstType } from '@/models/rsform';
|
||||
|
||||
import { labelGrammeme, labelReferenceType } from './labels';
|
||||
|
|
|
@ -9,7 +9,7 @@ import { AxiosHeaderValue, AxiosResponse } from 'axios';
|
|||
*/
|
||||
export function assertIsNode(e: EventTarget | null): asserts e is Node {
|
||||
if (e === null || !('nodeType' in e)) {
|
||||
throw new TypeError(`Expected 'Node' but recieved '${e?.constructor.name ?? 'null'}'`);
|
||||
throw new TypeError(`Expected 'Node' but received '${e?.constructor.name ?? 'null'}'`);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ export class TextMatcher {
|
|||
}
|
||||
|
||||
/**
|
||||
* Text substitution guided by mapping and regular explression.
|
||||
* Text substitution guided by mapping and regular expression.
|
||||
*/
|
||||
export function applyPattern(text: string, mapping: { [key: string]: string }, pattern: RegExp): string {
|
||||
if (text === '' || pattern === null) {
|
||||
|
@ -65,7 +65,7 @@ export function applyPattern(text: string, mapping: { [key: string]: string }, p
|
|||
}
|
||||
|
||||
/**
|
||||
* Check if Axios reponse is html.
|
||||
* Check if Axios response is html.
|
||||
*/
|
||||
export function isResponseHtml(response?: AxiosResponse) {
|
||||
if (!response) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user