Package org.axsl.i18n

Examples of org.axsl.i18n.Language


            throws HyphenationException {
        if (! testWord.toLowerCase().equals("hyphenation")) {
            throw new HyphenationException("Test of \"hyphenation\" has "
                    + "invalid input.");
        }
        final Language testLanguage = Language.findFromAlpha("en");
        final Hyphenation hyphenation = this.serverImplementation.hyphenate(
                testWord, 0, testWord.length(), testLanguage, null, 2, 2,
                false);
        assertNotNull(hyphenation);
        assertEquals(3, hyphenation.getPoints().length);
View Full Code Here


            throws HyphenationException {
        if (! testWord.toLowerCase().equals("obligatory")) {
            throw new HyphenationException("Test of \"obligatory\" has "
                    + "invalid input.");
        }
        final Language testLanguage = Language.findFromAlpha("en");
        final Hyphenation hyphenation = this.serverImplementation.hyphenate(
                testWord, 0, testWord.length(), testLanguage, null, 2, 2,
                false);
        assertNotNull(hyphenation);
        assertEquals(2, hyphenation.getPoints().length);
View Full Code Here

     * The actual test for {@link #testEnInvalidCharacter()}.
     * @throws HyphenationException For processing errors during hyphenation.
     */
    public void enInvalidCharacter() throws HyphenationException {
        final String testWord = "table8";
        final Language testLanguage = Language.findFromAlpha("en");
        final Hyphenation hyphenation = this.serverImplementation.hyphenate(
                testWord, 0, testWord.length(), testLanguage, null, 2, 2,
                false);
        assertNull(hyphenation);
    }
View Full Code Here

     * Convert a String language descriptor to its DtLanguage equivalent.
     * @param languageCode The String language descriptor to be converted.
     * @return The DtLanguage instance for {@code languageCode}.
     */
    public static DtLanguage makeLanguageDT(final String languageCode) {
        final Language iso639 = Language.findFromAlpha(languageCode);
        if (iso639 == null) {
            return null;
        }
        return new DtLanguage(languageCode);
    }
View Full Code Here

     */
    protected int processLineText(final LineText lineText, final int start,
            final int end) throws TextException {
        this.currentLineText = lineText;
        this.currentChars = this.currentLineText.inlineText();
        final Language languageInstance = lineText.inlineLanguage();
        final String language = languageInstance.getAbbrev3();

        this.finalWidth = 0;
        this.wordWidth = 0;
        this.wordStart = 0;
        this.spaceWidth = 0;
View Full Code Here

         * backward at any text in the same LineText item, and then to prior
         * LineText items to find the beginning of the word.
         */
        final HyphenationServer server =
                this.getTextServer().getHyphenationServer();
        final Language language = this.currentLineText.inlineLanguage();
        final Country country = this.currentLineText.inlineCountry();
        // Count the number of chars at the beginning that should be ignored.
        final int actualWordStart = server.wordStarts(this.currentChars,
                this.wordStart, language, country);
        if (actualWordStart < 0) {
View Full Code Here

     * @param languageCode The ISO-639 code for the language sought.
     * @return The suitable instance for {@code languageCode}.
     */
    public NaturalLanguage getNaturalLanguage(
            final String languageCode) {
        final Language iso639 = Language.findFromAlpha(languageCode);
        return this.getNaturalLanguage(iso639);
    }
View Full Code Here

     * @return A new instance for {@code languageCode}, or null if an
     * instance already exists for it.
     */
    public NaturalLanguage makeNaturalLanguage(
            final String languageCode) {
        final Language iso639 = Language.findFromAlpha(languageCode);
        final NaturalLanguage existingLang = this.getNaturalLanguage(iso639);
        if (existingLang != null) {
            /* If the instance already exists, don't return a new one for the
             * same language code. */
            return null;
View Full Code Here

     * {@inheritDoc}
     */
    public Language traitLanguage(final FoContext context) {
        final String languageCode = this.getPropertyList().getLanguage(this,
                context);
        final Language iso639 = Language.findFromAlpha(languageCode);
        if (iso639 == null) {
            return Language.NULL;
        } else {
            return iso639;
        }
View Full Code Here

TOP

Related Classes of org.axsl.i18n.Language

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.