# Marcion

Marcion RC3
Marcion is Coptic - English/Czech dictionary related to Crum's Coptic dictionary, written in C++, based on MySql, with Qt4 GUI. Contains many Coptic texts, grammars, Greek texts, Liddel-Scott Greek-English lexicon, and others. It can be used as a Bible-study tool.

## Installation and startup

More useful is to install all fonts from folder 'fonts' into your OS and turn off switch load internal fonts at startup in form settings (Main menu: application->settings ). Fonts SP Tiberian and SP Achmim are used due grammar of J.M. Plumley

### Linux

Prerequisities:
* Qt >= 4.6.0
* djvulibre >=3.5.22
Download 'marcion_rc3-linux-x86.tar.bz2' and unpack it. Run executable 'marcion' in main directory. If output of ldconfig -p not contains important Qt libraries (for example if Qt is installed in /opt), edit /etc/ld.so.conf and execute ldconfig, or execute marcion with LD_LIBRARY_PATH .
for example:

### Windows

Download 'marcion_rc3-win32.zip'. Unpack it and run marcion.exe

## Building from sources
### Tarball

Prerequisities:
these packages are necessary, headers and libraries:
* qt4 >= 4.6.0
* djvulibre >= 3.5.21
* mysql = 5.1.41
* libbzip2 >= 1.0.5
* glibc >= 2.9
you must have installed build tool
* scons >= 1.2.0
If you are using binary packages presented in your distro, ensure, that you have also installed “devel” packages with headers.
Download source package and unpack it. Navigate into directory 'marcion-src' and run scons with these parameters:

#### qt4lib

    default value "/usr/lib/"

#### qt4inc

    default value "/usr/lib/qt4/include/"

#### djvulibrelib

    default value "/usr/lib/"

#### djvulibreinc

    default value "/usr/include/"

#### mysqllib

    default value "/usr/local/mysql/lib/"

#### mysqlinc

    default value "/usr/local/mysql/include/"

#### bzip2lib

    default value "/usr/lib/"

#### bzip2inc

    default value "/usr/include/"

#### glibclib

    default value "/usr/lib/"

#### glibcinc

    default value "/usr/include/"

#### install

    no value

#### installdir

    default value "/opt/marcion/"
Assign to each variable correct value. You can also edit file 'SConstruct' and into command beginning with 'd=env.ParseFlags' insert additional flags for compiler.
example: If you have Qt installed in '/opt', GlibC and bzip2 in '/usr', MySql in '/opt/mysql' and DjVuLibre in '/home/user/software' and you want to have Marcion installed into '/home/user/software/marcion', do this:

### SVN

Prerequisites:
these packages are necessary, headers and libraries:
* qt4 >= 4.5
* djvulibre >= 3.5.21
* mysql = 5.1.41
* libbzip2 >= 1.0.5
* glibc >= 2.9
you must have installed build tool
* cmake >= 2.8
If you are using binary packages presented in your distro, ensure that you have also installed “devel” packages with headers.
Checkout source tree from svn repository.
Download proper gzipped mysql tar binary archive for your platform into directory 'depends' and unpack it. Create symlink 'mysql' pointed to 'mysql*' directory. (Tested on version 5.1.41, but newer versions should work also. If you have installed mysql in your OS already, you can use variables M_EXTRA_MYSQL_INC and M_EXTRA_MYSQL_LIB) Download data from project page, directory 'devel' file 'mdata.tar.bz2' into directory 'depends' and unpack it. (If you have marcion installed already and you want use data from it, use variable M_MARCION_DATA)
example:
Run cmake with these parameters:

#### M_EXTRA_DJVULIBRE_INC

    default value ""

#### M_EXTRA_DJVULIBRE_LIB

    default value ""

#### M_EXTRA_MYSQL_INC

    default value "depends/mysql/include"

#### M_EXTRA_MYSQL_LIB

    defaultní value "depends/mysql/lib"

#### QT_QMAKE_EXECUTABLE

    default value ""

#### M_MARCION_DATA

    default value "depends/mdata"

#### CMAKE_INSTALL_PREFIX

    default value "$HOME/MarcionRC3svn"
examples:
If you have all packages installed in obvious system places and you wish to have installed marcion in '$HOME/MarcionRC3svn', execute
If you wish to install marcion into different place, for example '/home/user/marc-svn', use variable CMAKE_INSTALL_PREFIX
If you have Qt installed in '/opt', GlibC and bzip2 in '/usr', MySql in '/opt/mysql' and DjVuLibre in '/home/user/software' and you want to have Marcion installed into '/home/user/software/marcion', do this:
or alternatively execute cmake in interactive mode and set values in prompt line
After successful configuration execute:
notes:
Parameter -L shows you current content of all variables in cache.
Execute
and learn more about this powerful tool.
You can also try

## Usage

(fonts New Athena Unicode and Ezra SIL are needed)

### Dictionaries
#### Coptic (Crum)
##### printed (djvu)

Main menu: action->crum (coptic)
Dictionary is viewed by DjView component, so you can use all features of this browser. On the top panel is an editable combobox containing letters for navigation through dictionary. You must select char(s) from list or insert two chars (one char + space). Chars can be latin or coptic (table).

##### text (mysql)

Hlavní menu: action->crum-query(coptic)
Shows window with GUI for searching words in Crum's Dictionary. Database is still under construction, for now contains 3350 words, 4837 derivations and over 48 000 indexed items.
Data import:
Content of dictionary is possible to backup into .csv (2 files) or .sql file.(Main menu: database->local->export coptic tables->csv, database->local->export coptic tables->sql)
Data export:
Main menu: database->local->import data
Only for .sql files. Upgrades of database are placed in project page in folder 'extras/crum-data' . After successful import rebuild index.(Main menu: database->local->(re)create index of coptic tables).
GUI contains these components:
* numeric fields (limit of output)
* switch

      ###### direct

          search word directly

      ###### index

          search word through index
* checkboxes

      ###### show czech

          (don't) show czech

      ###### greek equivs

          (don't) show greek

      ###### show derivations

          (don't) derivations
* tabs

      ###### coptic

          search for coptic word

         ###### exact

             exact match

         ###### like

             '%' stands for any group of chars (including empty) and '_' stand for exactly one char. (official documentation)

         ###### regexp

             match regexp regular expression (official documentation)

      ###### dialects

          filter by dialect

      ###### czech/english

          fulltext search of czech/english text

      ###### greek

          fulltext search of greek text

      ###### crum

          shows words by pages
* toolbar with output components

      ###### tree

          complete view

      ###### show

          navigates to word

      ###### show all in tree

          complete view of entire result
* outpitTemplate:Fix/category text area
There are two ways how to search in dictionary - directly or through index.

###### direct search (obsolete)

You can use Latin and Coptic script, mixed also. If option exact is enabled, then non-word chars and spaces are removed after query. Spaces are always ignored. After query inpu text is converted into Latin.
Looks only for complete word, like ⲛⲟⲃⲉ, ⲛⲁⲃⲉ, ⲛⲟⲃⲓ - not ⲣ.ⲛⲟⲃⲉ, ⲣ.ⲛⲁⲃⲉ, ⲉⲣ.ⲛⲟⲃⲓ, ⲣⲉϥ.ⲣ.ⲛⲟⲃⲉ etc.

###### through index (recommended)

Index contains whole words and their combinations with various kinds of words - so you can search for words like ⲁⲧ.ⲣⲱⲙⲉ, ⲙⲛⲧ.ⲁⲧ.ⲧⲁⲕⲟ, ϯ.ⲡⲁϩⲣⲉ, ⲉⲓ ⲉⲃⲟⲗ, ⲣⲙ.ⲛ.ϩⲏⲧ etc. After import of data of dictionary (files "crumX-Y.sql.bz2") and after manual editing is important to rebuild index (Main menu: database->local->(re)create index of coptic tables). Function resolve of popup menu of toolbox tree shows how index is built.

#### Greek (LSJ)

* tabs

      ##### search in dictionary

          base morph

      ##### parse inflection

          indicates word class and morph
* options

      ##### switch tr

          (don't) convert

      ##### exact

          exact match

      ##### regexp

          matches regular expression (official documentation)
Compared is text of output field (converted text).

### Grammars
#### J.M. Plumley

An Introductory Coptic Grammar

#### H. Tattam

A Compendious Grammar Of The Egyptian Language

### special components
#### Translit widget

Component works with one of four scripts:
* Latin
* Greek
* Coptic
* Hebrew
widgets:

##### editable text field

    input text

##### output text field

    converted text

##### switch tr

    (don't) convert
popup menu:

##### copy

    copy content of output text field into clipboard

##### clear

    clear all

##### update

    convert text of input text field into Latin and replace it

##### strip

    remove non-word chars

##### update+strip

    both

### Library

Hierarchy of items of library is ordered in four levels:
* script
* language
* collection
* book
Only collections can be added or removed.

#### maintaining
##### add collection

Main menu: library->import collection případně database->local->import data
Files with collections (.sql or compressed .sql.bz2) are stored in folder 'data/backup' and on page of project in folder 'texts'.

##### create index

popup menu of library component: index->create index
Collection can be searchable only if index of it is built. Informations about state of collections shows popup menu of library component: index->show .

##### remove collection

popup menu of library component: delete a delete all
If collection is deleted, is deleted its index also.

#### searching

Main menu: library->search library
components of panel:

   ##### list of scripts

       choose script

   ##### list of languages

       choose language

   ##### list of collections

       collections written in chosen language
* tabs

      ##### simple

          search for one word/phrase

      ##### extended

          using of logical operators
* switch

      ##### word

          search for word

      ##### phrase

          search for phrase

   ##### numeric fields

       limits of output
* button query
In lists choose language, script and check collections in which will be searched. If collection have no index, then is inactive and cannot be checked.
Types of index:

##### simple

    All words of verse and entire verse are indexed.

##### extended

    All words of verse, entire verse, entire next verse and combination of last word of first verse with first word of second verse are indexed.
Items of index are small letters without diacritic. Is possible to search word or phrase in extension of one verse, matched is always regular expression case insensitive without diacritic.
tab simple: Search for only one word or one phrase.
tab extended: logical operators
examples:
| option | tab | regular expression | result |
| word | simple | ^(ouaein|ouoein|ouoin)$ | returns verse, which contains minimal one of words ⲟⲩⲁⲉⲓⲛ, ⲟⲩⲟⲉⲓⲛ, ⲟⲩⲟⲓⲛ |
| word | simple | ^ou(ae|oe|o)in$ | returns verse, which contains minimal one of words ⲟⲩⲁⲉⲓⲛ, ⲟⲩⲟⲉⲓⲛ, ⲟⲩⲟⲓⲛ |
| word | simple | ^alhq | returns verse, which contains word beginning αληθ |
| word | extended | ^ui AND ^anqrwp | returns verse, which contains word beginning υι and word beginning ανθρωπ |
| phrase | simple | ui.+ anqrwp | returns verse, which contains text beginning υι followed by at least one char and space and word beginning ανθρωπ |

#### content of library

| collection | script | language |
| New Testament | coptic | coptic (sahidic dialect) |
| Nag Hammadi Library | coptic | coptic (sahidic dialect) |
| codex Tchacos | coptic | coptic (sahidic dialect) |
| codex Achmim | coptic | coptic (sahidic dialect) |
| Life of st. Anthony | coptic | coptic (sahidic dialect) |
| Pistis Sophia (djvu) | coptic | coptic (sahidic dialect) |
| Books of Ieu (djvu) | coptic | coptic (sahidic dialect) |
| Gospel of Thomas (djvu, photo) | coptic | coptic (sahidic dialect) |
| New Testament | coptic | coptic (bohairic dialect) |
| Septuagint | greek | greek |
| New Testament | greek | greek |
| Westminster Leningrad Codex | hebrew | hebrew |
| King James Version | latin | english |
| Bible of Kralice | latin | czech |
| Cesky ekumenicky preklad | latin | czech |

### Transscription

(fonts New Athena Unicode and Ezra SIL are needed)

#### greek and coptic

| char | Coptic | Greek |
| a | ⲁ | α |
| b | ⲃ | β |
| g | ⲅ | γ |
| d | ⲇ | δ |
| e | ⲉ | ε |
| z | ⲍ | ζ |
| h | ⲏ | η |
| q | ⲑ | θ |
| i | ⲓ | ι |
| k | ⲕ | κ |
| l | ⲗ | λ |
| m | ⲙ | μ |
| n | ⲛ | ν |
| j | ⲝ | ξ |
| o | ⲟ | ο |
| p | ⲡ | π |
| r | ⲣ | ρ |
| s | ⲥ | σ,ς |
| t | ⲧ | τ |
| u | ⲩ | υ |
| f | ⲫ | φ |
| x | ⲭ | χ |
| c | ⲯ | ψ |
| w | ⲱ | ω |
| S | ϣ | - |
| F | ϥ | - |
| H | ϩ | - |
| K | ϧ | - |
| Q | ⳉ | - |
| J | ϫ | - |
| G | ϭ | - |
| T | ϯ | - |
| V | ⲋ | - |

#### hebrew

| char | Hebrew |
| a | א |
| b | ב |
| g | ג |
| d | ד |
| e | ה |
| v | ו |
| z | ז |
| h | ח |
| t | ט |
| i | י |
| k | כ |
| l | ל |
| m | מ |
| n | נ |
| s | ס |
| y | ע |
| p | פ |
| c | צ |
| q | ק |
| r | ר |
| j | ש |
| u | ת |
| K | ך |
| C | ץ |
| P | ף |
| M | ם |
| N | ן |

## Instructional Videos
### YouTube

Marcion RC3 - import collection
Marcion RC3 - update coptic dictionary
Marcion RC3 - BookReader component

## Technical support

Maybe you have any trouble, or question or enhancement.

## External Links

* Marcion Home Page
* Marcion on SourceForge
* Mani on SourceForge
* Help forum
* Open Discussion forum