JS8Call-Improved master
Loading...
Searching...
No Matches
JSC_checker.cpp File Reference

JSCChecker class implementation. More...

#include "JSC_checker.h"
#include "JS8_Main/Varicode.h"
#include "JSC.h"
#include <QLoggingCategory>
#include <QTextBlock>
#include <QTextCursor>
#include <QTextDocument>
#include <QTextEdit>
#include <QTextLayout>
Include dependency graph for JSC_checker.cpp:

Functions

bool cursorHasProperty (const QTextCursor &cursor, int property)
 Check if the cursor has the specified property.
QString nextChar (QTextCursor c)
 Get the next character from the cursor.
bool isNumeric (QString s)
 Check if the string is numeric.
bool isWordChar (QString ch)
 Check if the character is a word character.
QSet< QString > oneEdit (QString word, bool includeAdditions, bool includeDeletions)
 Generate all candidate words that are one edit distance away.
QMultiMap< quint32, QString > candidates (QString word, bool includeTwoEdits)
 Generate candidate words that are one or two edit distances away.

Variables

const int CORRECT = QTextFormat::UserProperty + 10
const QString ALPHABET = {"ABCDEFGHIJKLMNOPQRSTUVWXYZ"}

Detailed Description

JSCChecker class implementation.

This file is part of JS8Call.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

(C) 2018 Jordan Sherer kn4cr.nosp@m.d@gm.nosp@m.ail.c.nosp@m.om - All Rights Reserved

Function Documentation

◆ candidates()

QMultiMap< quint32, QString > candidates ( QString word,
bool includeTwoEdits )

Generate candidate words that are one or two edit distances away.

Parameters
word
includeTwoEdits
Returns
QMultiMap<quint32, QString>
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cursorHasProperty()

bool cursorHasProperty ( const QTextCursor & cursor,
int property )

Check if the cursor has the specified property.

Parameters
cursor
property
Returns
true
false
Here is the caller graph for this function:

◆ isNumeric()

bool isNumeric ( QString s)

Check if the string is numeric.

Parameters
s
Returns
true
false
Here is the caller graph for this function:

◆ isWordChar()

bool isWordChar ( QString ch)

Check if the character is a word character.

Parameters
ch
Returns
true
false

◆ nextChar()

QString nextChar ( QTextCursor c)

Get the next character from the cursor.

Parameters
c
Returns
QString

◆ oneEdit()

QSet< QString > oneEdit ( QString word,
bool includeAdditions,
bool includeDeletions )

Generate all candidate words that are one edit distance away.

Parameters
word
includeAdditions
includeDeletions
Returns
QSet<QString>
Here is the caller graph for this function: