Skip to content

Commit

Permalink
Update documentation, support for finding statements folder in Qt
Browse files Browse the repository at this point in the history
  • Loading branch information
kovzol committed Jan 22, 2025
1 parent 07cfbb5 commit 8930e01
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 24 deletions.
3 changes: 2 additions & 1 deletion qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,5 @@ install(FILES io.github.kovzol.bibref.desktop DESTINATION share/applications)
install(FILES io.github.kovzol.bibref.metainfo.xml DESTINATION share/metainfo)

# Copy statements:
install(DIRECTORY ../statements/SBLGNT/ DESTINATION share/bibref-qt/statements PATTERN "all" EXCLUDE)
install(DIRECTORY ../statements/SBLGNT/ DESTINATION share/bibref-qt/statements/SBLGNT PATTERN "all" EXCLUDE)
install(DIRECTORY ../statements/StatResGNT/ DESTINATION share/bibref-qt/statements/StatResGNT PATTERN "all" EXCLUDE)
4 changes: 3 additions & 1 deletion qt/create-windows-folder
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,7 @@ for d in styles platforms; do

# Create statements folder...
mkdir $FOLDER/statements
cp -a ../statements/SBLGNT/* $FOLDER/statements
cp -a ../statements/SBLGNT $FOLDER/statements
rm -fr $FOLDER/statements/all # don't need to have the copies
cp -a ../statements/StatResGNT $FOLDER/statements
rm -fr $FOLDER/statements/all # don't need to have the copies
4 changes: 3 additions & 1 deletion qt/deploy-mac
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ test -d bin || {
}

mkdir -p "bin/bibref-qt.app/Contents/Resources/statements/"
cp ../statements/SBLGNT/*/* bin/bibref-qt.app/Contents/Resources/statements/
cp ../statements/SBLGNT/*/* bin/bibref-qt.app/Contents/Resources/statements/SBLGNT
rm -fr bin/bibref-qt.app/Contents/Resources/statements/all
cp ../statements/StatResGNT/*/* bin/bibref-qt.app/Contents/Resources/statements/StatResGNT
rm -fr bin/bibref-qt.app/Contents/Resources/statements/all
if [ -z "$2" ]; then
$MACDEPLOYQT bin/bibref-qt.app -dmg
Expand Down
10 changes: 10 additions & 0 deletions qt/io.github.kovzol.bibref.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@
<content_rating type="oars-1.1" />

<releases>
<release version="2025Jan22" date="2025-01-22">
<url type="details">https://github.com/kovzol/bibref/commits/07cfbb5d7eb8f06048da35d7195af2adf1981e8f/</url>
<description>
<p>Release description</p>
<ul>
<li>Support for statements from StatResGNT</li>
<li>Several bugfixes</li>
</ul>
</description>
</release>
<release version="2025Jan09" date="2025-01-09">
<url type="details">https://github.com/kovzol/bibref/commits/a1ccc8a9da542c915d917db28b9c642c926d6fbf/</url>
<description>
Expand Down
2 changes: 1 addition & 1 deletion qt/main.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef MAIN_H
#define MAIN_H

#define BIBREF_VERSION "2025Jan04"
#define BIBREF_VERSION "2025Jan22"
#define LOGO_FILE "logo-Psalm40-192.png"
#define SHARE_FOLDER "share/bibref-qt"

Expand Down
31 changes: 28 additions & 3 deletions qt/statementwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,34 @@ void StatementWindow::newFile()
void StatementWindow::openFile(const QString &path)
{
QString fileName = path;

if (fileName.isNull())
fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "", tr("bibref statement files (*.brst)"));
if (directory.isEmpty()) {
directory = qApp -> applicationDirPath();
QString d1 = directory + QDir::separator() + "statements";
const QFileInfo f1(d1);
QString d2 = directory + QDir::separator() + ".." + QDir::separator() + "statements";
const QFileInfo f2(d2);
QString d3 = directory + QDir::separator() + ".." + QDir::separator()
+ ".." + QDir::separator() + "statements";
const QFileInfo f3(d3);
QString d4 = directory + QDir::separator() + ".." + QDir::separator()
+ "share" + QDir::separator() + "statements";
const QFileInfo f4(d4);
if (f1.exists() && f1.isDir())
directory = d1;
else if (f2.exists() && f2.isDir())
directory = d2;
else if (f3.exists() && f3.isDir())
directory = d3;
else if (f4.exists() && f4.isDir())
directory = d4;
}

if (fileName.isNull()) {
fileName = QFileDialog::getOpenFileName(this, tr("Open File"), directory, tr("bibref statement files (*.brst)"));
QString basename = QUrl(fileName).fileName();
directory = fileName;
directory.remove(basename);
}

if (!fileName.isEmpty()) {
QFile file(fileName);
Expand Down
2 changes: 2 additions & 0 deletions qt/statementwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public slots:
Highlighter *highlighter;

string graphviz_input;
QString directory;

};

#endif
29 changes: 12 additions & 17 deletions statements/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
# Statements in **bibref**

In this folder there is experimental code that checks statements that can be exported
from the [quotation database](../docs/common/quotations.sql) via `make statements-files`
in that directory. The exported files have already been copied to the [tests](tests) folder.
In some cases they have been tailored or fine-tuned if the database cannot describe
some features.

The scenario is to move all database entries into **.brst** files and
make it possible to parse them syntactically and in content. The
syntactical check is already working via a flex/bison machinery. It is
extensible if further information needs to be added. The old database
should be obsoleted someday.
In this folder an implementation of statement checks is provided. The statements were exported
from the [SQL quotation database](../docs/common/quotations.sql) via `make statements-files`
in that directory and further processed with various (automatic and manual) steps. Now
the SQL quotation database is no longer used by the mainstream research.

The checks are described in the **.y** file. They are currently:

* syntactical parsing
* check if the passages are mentioned with their correct raw positions (including length)
* check if the passages are mentioned with their correct raw positions (including length) and a-y form
* check if introductional passages indeed contain the declarations and sources mentioned
* check fragment matches and Jaccard differences
* overall cover check (percentual)
Expand All @@ -24,13 +17,15 @@ The checks are described in the **.y** file. They are currently:
* check if OT headlines are well-chosen
* check if OT parts of fragments are unique

As a next step, these checks are planned to be integrated in the **bibref** program as well.
Currently, **bibref** can be compiled to give it a try (see the **cmake** machinery
These checks are integrated in the **bibref** program as well if
**bibref** is compiled with PBRST support (see the **cmake** machinery
for details). Any **.brst** example can be entered in the command line interface.
Later, this feature is planned to be included in the Qt version as well.
This feature is also included in the Qt version (if it is compiled with PBRST support).

The **.brst** entries can be visually graphed in the Qt version, or a GraphViz file
can be exported via the command line tool **pbrst-cli**.

The **.brst** entries could then be visually graphed, similarly to the SVG outputs of the
old database. Also, a user-maintained subset or extension of the **.brst** files could
It is planned that a user-maintained subset or extension of the **.brst** files could
be analyzed as a whole, for example, to be informed if two quotations are mentioned
consecutively. In fact, introductions of different quotations may overlap, because
the same introduction can indicate the author for different quotations, for example.
Expand Down

0 comments on commit 8930e01

Please sign in to comment.