Code Search for Developers
 
 
  

CMUDictionaryEnglishWordForm.java from Texai at Krugle


Show CMUDictionaryEnglishWordForm.java syntax highlighted


/*
 * CMUDictionaryEnglishWordForm.java
 *
 * Created on February 22, 2007, 1:55 PM
 *
 * Description:
 *
 * Copyright (C) 2007 Stephen L. Reed.
 *
 * This program is free software; you can redistribute it and/or modify it under the terms
 * of the GNU General Public License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program;
 * if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

package org.texai.cmudict.domainEntity;

import java.util.Set;
import javax.persistence.Id;
import org.texai.kb.Constants;
import org.texai.kb.persistence.DomainEntity;
import org.texai.kb.persistence.DomainProperty;

/**
 *
 * @author reed
 */
@DomainEntity(typeOf="LinguisticObjectType", subClassOf="EnglishWord")
public class CMUDictionaryEnglishWordForm {
  
  @Id
  /** the term id inserted by the container */
  private Long termId;                                     // NOPMD
  
  /** the word form */
  @DomainProperty(name=Constants.TERM_NAME_CMU_WORD_FORM, range="CharacterString", identifier=true)
  private String wordForm;                     // NOPMD
  
  /** the set of pronunciations */
  @DomainProperty(name="cxgARPABETPronounciation")
  private Set<ARPABETPronunciation> arpabetPronunciations;
  
  /** Creates a new instance of CMUDictionaryEnglishWordForm. */
  public CMUDictionaryEnglishWordForm() {
    super();
  }
  
  /** Creates a new instance of CMUDictionaryEnglishWordForm.
   * 
   * @param wordForm the word form
   * @param arpabetPronunciations the set of pronunciations
   */
  public CMUDictionaryEnglishWordForm(
          final String wordForm, 
          final Set<ARPABETPronunciation> arpabetPronunciations) {
    super();
    //Preconditions
    assert wordForm != null : "wordForm must not be null";
    assert arpabetPronunciations != null : "arpabetPronunciations must not be null";
    
    this.wordForm = wordForm;
    this.arpabetPronunciations = arpabetPronunciations;
  }
  
  /** Gets the term id.
   *
   * @return the term id
   */
  public Long getTermId() {
    return termId;
  }

  /** Gets the word form.
   *
   * @return the word form
   */
  public String getWordForm() {
    return wordForm;
  }
  
  /** Gets the set of pronunciations.
   *
   * @return the set of pronunciations
   */
  public Set<ARPABETPronunciation> getARPABETPronunciations() {
    return arpabetPronunciations;
  }
  
  /** Returns a string representation of this object.
   *
   * @return a string representation of this object
   */
  @Override
  public String toString() {
    return "[WORD FORM " + wordForm + "]";
  }
}




See more files for this project here

Texai

Texai is an chatbot that intelligently seeks to acquire knowledge and friendly behaviors.

Project homepage: http://sourceforge.net/projects/texai
Programming language(s): Java,Shell Script,XML
License: other

  ARPABETPhoneme.java
  ARPABETPhonemeAdapter.java
  ARPABETPronunciation.java
  CMUDictionaryEnglishWordForm.java
  package-info.java