eKorpus

Controllers

In Pylons framework URLs are mapped to controlles and controllers render the results using Mako templates.

Routing URLs

Routes configuration

The more specific and detailed routes should be defined first so they may take precedent over the more generic routes. For more information refer to the routes manual at http://routes.groovie.org/

ekorpus.config.routing.make_map()[source]

Create, configure and return the routes Mapper

User management

The admin module handles basic user management functions like creating new user accounts, deleting user accounts or modifying user data.

class ekorpus.controllers.admin.AdminController[source]

This class implements all user management functions.

default_language = 'et'
class State[source]
AdminController.index()[source]

Generates users homepage.

AdminController.signout()[source]

Signout.

AdminController.signin()[source]

Signs the user into system by verifying user credentials.

AdminController.lang(lg)[source]

Change UI language.

AdminController.list()[source]

List all users.

AdminController.sessions()[source]

List all test sessions

AdminController.profile(id)[source]

Show user profile.

AdminController.edit_mydata()[source]
AdminController.edit(id)[source]

Display user data for editing.

AdminController.save(id)[source]

Save user data.

AdminController.delete(id)[source]

Delete user account.

Recordings

The recordings handles all recordings management opoerations.

class ekorpus.controllers.recordings.RecordingsController[source]
parse_time(start)[source]
index(rid, sid)[source]

List all segments for the segmentation sid.

list()[source]

List all recordings.

add(id)[source]

Create a new recording for a speaker id and show the editing form.

edit(id)[source]

Generate an editing form for the recording id.

save(id)[source]

Save the data for the recording id.

delete(id)[source]

Delete all the data related to the recording id.

segmentation(id)[source]

Show the data for a segmentation with id.

Reports

The reports contains methods to generate various reports.

class ekorpus.controllers.reports.ReportsController[source]
list()[source]

List all reports.

segments()[source]

Generate a query form for selecting segmets with specified emotional properties.

segmentsresult()[source]

Generate the report for the query issued by form for segments().

wordsresult(emotion, level, neutraltext, pos)[source]

Generate the report for the query issued by form for segments().

phonemesresult(emotion, level, neutraltext)[source]

Generate the report for the query issued by form for segments().

scores()[source]

Generate sentence segment performance report as CSV file for Emu.

tests()[source]

Generate a query form for the tests.

testsresult(id, xml=None)[source]

Generates a report for a test id where for each item the performance of each is listed.

valence()[source]

Generate a query form for selecting segmets with specified valence properties.

valenceresult()[source]

Generate the report for the sentence valence recognition.

Valence

The valence contains text valence related methods.

class ekorpus.controllers.valence.ValenceController[source]
index()[source]

Generates the text input form.

color()[source]

Count and mark with a color the valence keywords.

Sounds

The sounds contains various methods for playing sound files.

ekorpus.controllers.sounds.save(wave, recording)[source]
ekorpus.controllers.sounds.slice(first, last)[source]
class ekorpus.controllers.sounds.SoundsController[source]
index()[source]
segment(first, last)[source]

Return a redirect to concecutive segments of a recording file.

recording(id)[source]

Return a redirect to full recording file.

Textgrid

The textgrid contains various Praat textgrid related operations.

ekorpus.controllers.textgrid.create_textgrid(first, last)[source]
class ekorpus.controllers.textgrid.TextgridController[source]
index()[source]
segment(first, last)[source]

Tests

The tests contains various tests management methods.

class ekorpus.controllers.tests.TestsController[source]

Test descriptin file format

description: text instruction: text language: code choices: name, choice=code,choice=code, ... choices: name, choice=code,choice=code, ... item: choices, text item: choices, text

list()[source]

List tests available to a user

edit(id)[source]

Generate edit form for a test id.

save(id)[source]

Save data for a test id.

build(id)[source]

Generate a form for building a test interactively.

addsegment(id)[source]

Add an item to test.

removesegment(id)[source]

Remove an item from the test.

order(id)[source]

Save the item order. Item ids are prefixed with i_ or s_. Items with s_ are new items.

delete(id)[source]

Delete a test.

test(id)[source]

Generate test for a session

show(id, uid)[source]

Show the test id results for the user uid

legend(id)[source]
results(id)[source]

Save test session results

Default template

class ekorpus.controllers.template.TemplateController[source]
view(url)[source]

By default, the final controller tried to fulfill the request when no other routes match. It may be used to display a template when all else fails, e.g.:

def view(self, url):
    return render('/%s' % url)

Or if you’re using Mako and want to explicitly send a 404 (Not Found) response code when the requested template doesn’t exist:

import mako.exceptions

def view(self, url):
    try:
        return render('/%s' % url)
    except mako.exceptions.TopLevelLookupException:
        abort(404)

By default this controller aborts the request with a 404 (Not Found)

Export

export — Export data in XML format

class ekorpus.controllers.export.ExportController[source]

This class exports test data.

export(id)[source]

Export test data for test id.

Error handler

class ekorpus.controllers.error.ErrorController[source]

Generates error documents as and when they are required.

The ErrorDocuments middleware forwards to ErrorController when error related status codes are returned from the application.

This behaviour can be altered by changing the parameters to the ErrorDocuments middleware in your config/middleware.py file.

document()[source]

Render the error document

img(id)[source]

Serve Pylons’ stock images

style(id)[source]

Serve Pylons’ stock stylesheets