phon-ca / phon

Phon is a software program that greatly facilitates a number of tasks related to the analysis of phonological data.
https://www.phon.ca
Other
43 stars 4 forks source link

Moving towards a Phon Query Language #188

Open ghedlund opened 2 years ago

ghedlund commented 2 years ago

Current query filter options are general, but often confusing. These general filters should be expanded to include additional 'canned' filters with tighter options.

Query filters are categorized by domain: group, word, or syllable. The query domain is defined by the existence of a filters. For backwards compatibility, the current filters for each domain should be retained (but hidden to the user as 'advanced' options.) In place, one ore more statements of the form: Groups/Word/Syllable must contain X, Group/Word/Syllable must have X sub-elements, etc.

The following is a list of possible statements:

(Please edit list above as necessary)

ghedlund commented 2 years ago

This could be seen as moving towards a query language: (e.g.,)

// Single session context
FIND PHONEX /\c/ IN
SELECT "IPA Target"
WHERE GROUP {
    CONTAINS "p"
}
WHERE WORD {
    "IPA Actual" CONTAINS PHONEX /\c\v/
}
WHERE SYLLABLE {
        HAS PRIMARY STRESS
}
INCLUDE ALIGNED PHONES
INCLUDE "IPA Actual (Word)", "Alignment (Word)"
INCLUDE PCC()
// Single session context with record selection
FIND PHONEX /\c/ IN
SELECT "IPA Target"
WHERE GROUP {
    "IPA Target" CONTAINS "p"
}
WHERE WORD {
    "IPA Actual" CONTAINS PHONEX /\c\v/
}
WHERE SYLLABLE {
        HAS PRIMARY STRESS
}
FROM 1, 2, 3..9
INCLUDE ALIGNED PHONES
INCLUDE "IPA Actual (Word)", "Alignment (Word)"
// project context selecting all sessions in a corpus
FIND * IN
SELECT "IPA Target"
FROM "Corpus.*"
WHERE SPEAKER {
        IS FEMALE
        AND ROLE EQUALS "Target Child"
}
INCLUDE ALIGNED PHONES
INCLUDE "IPA Actual (Word)", "Alignment (Word)"
// free context selecting from files
FIND * IN
SELECT "IPA Target"
FROM "path/to/session.xml", "path/to/chatfile.cha"
INCLUDE ALIGNED PHONES
INCLUDE "IPA Actual (Word)", "Alignment (Word)"