jmrc
Class MRCDatabase

java.lang.Object
  extended by jmrc.LexicalDatabase
      extended by jmrc.MRCDatabase

public class MRCDatabase
extends LexicalDatabase

Implementation of the MRC Psycholinguistic database, based on a LinkedHashMap.

Version:
1.0
Author:
Francois Mairesse, http://www.dcs.shef.ac.uk/~francois

Field Summary
static Field FIELD_AOA
          Age of acquisition
static Field FIELD_BROWN_FREQ
          Brown frequency
static Field FIELD_CONC
          Concreteness
static Field FIELD_FAM
          Familiarity
static Field FIELD_IMAG
          Imagability
static Field FIELD_K_F_FREQ
          K F frequency
static Field FIELD_K_F_NCATS
          K F number of categories
static Field FIELD_K_F_NSAMP
          K F number of samples
static Field FIELD_MEANC
          Meaningfulness (Colorado norms)
static Field FIELD_MEANP
          Meaningfulness (Paivo norms)
static Field FIELD_NLET
          Number of letters
static Field FIELD_NPHON
          Number of phonemes
static Field FIELD_NSYL
          Number of syllables
static Field FIELD_T_L_FREQ
          T L frequency
 
Constructor Summary
MRCDatabase(java.io.File dbFile)
          Loads MRC Database with default number of entries.
MRCDatabase(java.io.File dbFile, int size)
          Loads the MRC database into memory.
 
Method Summary
 java.util.List<Field> getFields()
          Returns all the fields of the MRC database.
 int getValue(java.lang.String word, MRCPoS pos, Field field)
          Returns an integer feature value from the database.
 int getValue(java.lang.String word, java.lang.String pos, Field field)
          Returns an integer feature value from the database.
 
Methods inherited from class jmrc.LexicalDatabase
addEntriesFrom, containsEntry, containsField, containsField, getLexiconComparator, getMap, getValue, getValue, getValue, getValue, getWords, getWords, putValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIELD_NLET

public static final Field FIELD_NLET
Number of letters


FIELD_NPHON

public static final Field FIELD_NPHON
Number of phonemes


FIELD_NSYL

public static final Field FIELD_NSYL
Number of syllables


FIELD_K_F_FREQ

public static final Field FIELD_K_F_FREQ
K F frequency


FIELD_K_F_NCATS

public static final Field FIELD_K_F_NCATS
K F number of categories


FIELD_K_F_NSAMP

public static final Field FIELD_K_F_NSAMP
K F number of samples


FIELD_T_L_FREQ

public static final Field FIELD_T_L_FREQ
T L frequency


FIELD_BROWN_FREQ

public static final Field FIELD_BROWN_FREQ
Brown frequency


FIELD_FAM

public static final Field FIELD_FAM
Familiarity


FIELD_CONC

public static final Field FIELD_CONC
Concreteness


FIELD_IMAG

public static final Field FIELD_IMAG
Imagability


FIELD_MEANC

public static final Field FIELD_MEANC
Meaningfulness (Colorado norms)


FIELD_MEANP

public static final Field FIELD_MEANP
Meaningfulness (Paivo norms)


FIELD_AOA

public static final Field FIELD_AOA
Age of acquisition

Constructor Detail

MRCDatabase

public MRCDatabase(java.io.File dbFile)
            throws java.io.IOException
Loads MRC Database with default number of entries.

Parameters:
dbFile - file mrc2.dct from the MRC Psycholinguistic Database directory.
Throws:
java.io.IOException

MRCDatabase

public MRCDatabase(java.io.File dbFile,
                   int size)
            throws java.io.IOException
Loads the MRC database into memory.

Parameters:
dbFile - file mrc2.dct from the MRC Psycholinguistic Database directory.
size - number of entries in the file.
Throws:
java.io.IOException
Method Detail

getValue

public int getValue(java.lang.String word,
                    MRCPoS pos,
                    Field field)
             throws QueryException
Returns an integer feature value from the database.

Parameters:
word - Lemma of the word to look for.
pos - Part-of-Speech of the word.
field - Field of the database providing the value.
Returns:
value.
Throws:
QueryException - if the word/PoS/Field isn't found, or if the value is undefined (e.g. 0 value for some fields).

getValue

public int getValue(java.lang.String word,
                    java.lang.String pos,
                    Field field)
             throws QueryException
Returns an integer feature value from the database.

Parameters:
word - Lemma of the word to look for.
pos - String representation of the Part-of-Speech of the word.
field - Field of the database providing the value.
Returns:
value.
Throws:
QueryException - if the word/PoS/Field isn't found, or if the value is undefined (e.g. 0 value for some fields).

getFields

public java.util.List<Field> getFields()
Returns all the fields of the MRC database.

Overrides:
getFields in class LexicalDatabase