Examples of Hyphenation


Examples of org.apache.fop.layout.hyphenation.Hyphenation

                     + currentFontState.getCharWidth(inwordPunctuation));
            }
        }

        // are there any hyphenation points
        Hyphenation hyph =
            Hyphenator.hyphenate(hyphProps.language, hyphProps.country,
                                 wordToHyphenate,
                                 hyphProps.hyphenationRemainCharacterCount,
                                 hyphProps.hyphenationPushCharacterCount);
        if (hyph == null && preString == null) {
            // no hyphenation points and no inword non letter character
            return wordStart;
        } else if (hyph == null && preString != null) {
            // no hyphenation points, but a inword non-letter character
            remainingString.append(preString.toString());
            this.addWord(remainingString, startw, ls, textState);
            return wordStart + remainingString.length();
        } else if (hyph != null && preString == null) {
            // hyphenation points and no inword non-letter character
            int index = getFinalHyphenationPoint(hyph, remainingWidth);
            if (index != -1) {
                remainingString.append(hyph.getPreHyphenText(index));
                remainingString.append(this.hyphProps.hyphenationChar);
                this.addWord(remainingString, startw, ls, textState);
                return wordStart + remainingString.length() - 1;
            }
        } else if (hyph != null && preString != null) {
            // hyphenation points and a inword non letter character
            int index = getFinalHyphenationPoint(hyph, remainingWidth);
            if (index != -1) {
                remainingString.append(preString.append(hyph.getPreHyphenText(index)).toString());
                remainingString.append(this.hyphProps.hyphenationChar);
                this.addWord(remainingString, startw, ls, textState);
                return wordStart + remainingString.length() - 1;
            } else {
                remainingString.append(preString.toString());
View Full Code Here

Examples of org.apache.fop.layout.hyphenation.Hyphenation

                                   this.currentFontState.width(currentFontState.mapChar(inwordPunctuation)));
            }
        }

        //are there any hyphenation points
        Hyphenation hyph = Hyphenator.hyphenate(hyphProps.language,
            hyphProps.country, wordToHyphenate,hyphProps.hyphenationRemainCharacterCount,hyphProps.hyphenationPushCharacterCount);
        //no hyphenation points and no inword non letter character
        if (hyph == null && preString == null) {
            if (remainingString.length() > 0) {
                return wordStart-1;
            } else {
                return wordStart;
            }

        //no hyphenation points, but a inword non-letter character
        } else if (hyph == null && preString != null){
            remainingString.append(preString);
            this.addWord(startChar,remainingString);
            return wordStart + remainingString.length();
        //hyphenation points and no inword non-letter character
        } else if (hyph != null && preString == null)  {
            int index = getFinalHyphenationPoint(hyph,remainingWidth);
            if (index != -1) {
                remainingString.append(hyph.getPreHyphenText(index));
                remainingString.append(this.hyphProps.hyphenationChar);
                this.addWord(startChar,remainingString);
                return wordStart + remainingString.length()-1;
            }
        //hyphenation points and a inword non letter character
        } else if (hyph != null && preString != null) {
            int index = getFinalHyphenationPoint(hyph,remainingWidth);
            if (index != -1) {
              remainingString.append(preString.append(hyph.getPreHyphenText(index)));
              remainingString.append(this.hyphProps.hyphenationChar);
              this.addWord(startChar,remainingString);
              return wordStart + remainingString.length()-1;
            } else {
              remainingString.append(preString) ;
View Full Code Here

Examples of org.apache.fop.layout.hyphenation.Hyphenation

                     + this.currentFontState.width(currentFontState.mapChar(inwordPunctuation)));
            }
        }

        // are there any hyphenation points
        Hyphenation hyph =
            Hyphenator.hyphenate(hyphProps.language, hyphProps.country,
                                 wordToHyphenate,
                                 hyphProps.hyphenationRemainCharacterCount,
                                 hyphProps.hyphenationPushCharacterCount);
        // no hyphenation points and no inword non letter character
        if (hyph == null && preString == null) {
            if (remainingString.length() > 0) {
                return wordStart - 1;
            } else {
                return wordStart;
            }

            // no hyphenation points, but a inword non-letter character
        } else if (hyph == null && preString != null) {
            remainingString.append(preString);
            // is.addMapWord(startChar,remainingString);
            this.addWord(startChar, remainingString);
            return wordStart + remainingString.length();
            // hyphenation points and no inword non-letter character
        } else if (hyph != null && preString == null) {
            int index = getFinalHyphenationPoint(hyph, remainingWidth);
            if (index != -1) {
                remainingString.append(hyph.getPreHyphenText(index));
                remainingString.append(this.hyphProps.hyphenationChar);
                // is.addMapWord(startChar,remainingString);
                this.addWord(startChar, remainingString);
                return wordStart + remainingString.length() - 1;
            }
            // hyphenation points and a inword non letter character
        } else if (hyph != null && preString != null) {
            int index = getFinalHyphenationPoint(hyph, remainingWidth);
            if (index != -1) {
                remainingString.append(preString.append(hyph.getPreHyphenText(index)));
                remainingString.append(this.hyphProps.hyphenationChar);
                // is.addMapWord(startChar,remainingString);
                this.addWord(startChar, remainingString);
                return wordStart + remainingString.length() - 1;
            } else {
View Full Code Here

Examples of org.apache.fop.layout.hyphenation.Hyphenation

                                   this.currentFontState.width(currentFontState.mapChar(inwordPunctuation)));
            }
        }

        //are there any hyphenation points
        Hyphenation hyph = Hyphenator.hyphenate(hyphProps.language,
            hyphProps.country, wordToHyphenate,hyphProps.hyphenationRemainCharacterCount,hyphProps.hyphenationPushCharacterCount);
        //no hyphenation points and no inword non letter character
        if (hyph == null && preString == null) {
            if (remainingString.length() > 0) {
                return wordStart-1;
            } else {
                return wordStart;
            }

        //no hyphenation points, but a inword non-letter character
        } else if (hyph == null && preString != null){
            remainingString.append(preString);
                //is.addMapWord(startChar,remainingString);
            this.addWord(startChar,remainingString);
            return wordStart + remainingString.length();
        //hyphenation points and no inword non-letter character
        } else if (hyph != null && preString == null)  {
            int index = getFinalHyphenationPoint(hyph,remainingWidth);
            if (index != -1) {
                remainingString.append(hyph.getPreHyphenText(index));
                remainingString.append(this.hyphProps.hyphenationChar);
                    //is.addMapWord(startChar,remainingString);
                this.addWord(startChar,remainingString);
                return wordStart + remainingString.length()-1;
            }
        //hyphenation points and a inword non letter character
        } else if (hyph != null && preString != null) {
            int index = getFinalHyphenationPoint(hyph,remainingWidth);
            if (index != -1) {
              remainingString.append(preString.append(hyph.getPreHyphenText(index)));
              remainingString.append(this.hyphProps.hyphenationChar);
                  //is.addMapWord(startChar,remainingString);
              this.addWord(startChar,remainingString);
              return wordStart + remainingString.length()-1;
            } else {
View Full Code Here

Examples of org.apache.fop.layout.hyphenation.Hyphenation

                remainingWidth -= (getWordWidth(wordToHyphenate) + this.currentFontState.width(inwordPunctuation));
            }
        }

        //are there any hyphenation points
        Hyphenation hyph = Hyphenator.hyphenate(language,country,wordToHyphenate,hyphenationRemainCharacterCount,hyphenationPushCharacterCount);
        //no hyphenation points and no inword non letter character
        if (hyph == null && preString == null) {
            if (remainingString.length() > 0) {
                return wordStart-1;
            } else {
                return wordStart;
            }

        //no hyphenation points, but a inword non-letter character
        } else if (hyph == null && preString != null){
            remainingString.append(preString);
            this.addWord(startChar,remainingString);
            return wordStart + remainingString.length();
        //hyphenation points and no inword non-letter character
        } else if (hyph != null && preString == null)  {
            int index = getFinalHyphenationPoint(hyph,remainingWidth);
            if (index != -1) {
                remainingString.append(hyph.getPreHyphenText(index));
                remainingString.append(this.hyphenationChar);
                this.addWord(startChar,remainingString);
                return wordStart + remainingString.length()-1;
            }
        //hyphenation points and a inword non letter character
        } else if (hyph != null && preString != null) {
            int index = getFinalHyphenationPoint(hyph,remainingWidth);
            if (index != -1) {
              remainingString.append(preString.append(hyph.getPreHyphenText(index)));
              remainingString.append(this.hyphenationChar);
              this.addWord(startChar,remainingString);
              return wordStart + remainingString.length()-1;
            } else {
              remainingString.append(preString) ;
View Full Code Here

Examples of org.apache.lucene.analysis.compound.hyphenation.Hyphenation

  }

  @Override
  protected void decomposeInternal(final Token token) {
    // get the hyphenation points
    Hyphenation hyphens = hyphenator.hyphenate(token.termBuffer(), 0, token
        .termLength(), 1, 1);
    // No hyphen points found -> exit
    if (hyphens == null) {
      return;
    }

    final int[] hyp = hyphens.getHyphenationPoints();
    char[] lowerCaseTermBuffer=makeLowerCaseCopy(token.termBuffer());

    for (int i = 0; i < hyp.length; ++i) {
      int remaining = hyp.length - i;
      int start = hyp[i];
View Full Code Here

Examples of org.apache.lucene.analysis.compound.hyphenation.Hyphenation

    return tree;
  }

  protected void decomposeInternal(final Token token) {
    // get the hyphenation points
    Hyphenation hyphens = hyphenator.hyphenate(token.termBuffer(), 0, token
        .termLength(), 1, 1);
    // No hyphen points found -> exit
    if (hyphens == null) {
      return;
    }

    final int[] hyp = hyphens.getHyphenationPoints();
    char[] lowerCaseTermBuffer=makeLowerCaseCopy(token.termBuffer());

    for (int i = 0; i < hyp.length; ++i) {
      int remaining = hyp.length - i;
      int start = hyp[i];
View Full Code Here

Examples of org.apache.lucene.analysis.compound.hyphenation.Hyphenation

  }

  @Override
  protected void decomposeInternal(final Token token) {
    // get the hyphenation points
    Hyphenation hyphens = hyphenator.hyphenate(token.termBuffer(), 0, token
        .termLength(), 1, 1);
    // No hyphen points found -> exit
    if (hyphens == null) {
      return;
    }

    final int[] hyp = hyphens.getHyphenationPoints();
    char[] lowerCaseTermBuffer=makeLowerCaseCopy(token.termBuffer());

    for (int i = 0; i < hyp.length; ++i) {
      int remaining = hyp.length - i;
      int start = hyp[i];
View Full Code Here

Examples of org.apache.lucene.analysis.compound.hyphenation.Hyphenation

  }

  @Override
  protected void decompose() {
    // get the hyphenation points
    Hyphenation hyphens = hyphenator.hyphenate(termAtt.buffer(), 0, termAtt.length(), 1, 1);
    // No hyphen points found -> exit
    if (hyphens == null) {
      return;
    }

    final int[] hyp = hyphens.getHyphenationPoints();

    for (int i = 0; i < hyp.length; ++i) {
      int remaining = hyp.length - i;
      int start = hyp[i];
      CompoundToken longestMatchToken = null;
View Full Code Here

Examples of org.apache.lucene.analysis.compound.hyphenation.Hyphenation

    return tree;
  }

  protected void decomposeInternal(final Token token) {
    // get the hpyphenation points
    Hyphenation hyphens = hyphenator.hyphenate(token.termBuffer(), 0, token
        .termLength(), 1, 1);
    // No hyphen points found -> exit
    if (hyphens == null) {
      return;
    }

    final int[] hyp = hyphens.getHyphenationPoints();
    char[] lowerCaseTermBuffer=makeLowerCaseCopy(token.termBuffer());

    for (int i = 0; i < hyp.length; ++i) {
      int remaining = hyp.length - i;
      int start = hyp[i];
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.