Examples of XSpellAlternatives


Examples of com.sun.star.linguistic2.XSpellAlternatives

    public void _spell() {
        boolean res = true;
        try {
            log.println("Checking 'original' Spellchecker");
            PropertyValue[] empty = new PropertyValue[0] ;
            XSpellAlternatives alt = oObj.spell(
                            "Summersun",new Locale("en","US",""),empty);
            String alternatives = alt.getAlternatives()[0];
            res = (alternatives != null);
            log.println("Result so far is - "+ (res ? "OK" : "failed"));           
            log.println("Checking alternative Spellchecker");
            alt =alternative.spell(
                            "Summersun",new Locale("en","US",""),empty);
            alternatives = alt.getAlternatives()[0];
            res &= (alternatives != null);
        } catch (com.sun.star.lang.IllegalArgumentException ex) {
            log.println("Exception while checking 'spell'");
            res = false;
            ex.printStackTrace(log);
View Full Code Here

Examples of com.sun.star.linguistic2.XSpellAlternatives

            bIsCorrect = mxSpell.isValid( aWord, aLocale , aEmptyProps );
            System.out.println( aWord + ": " +  bIsCorrect );   


            aWord = "house";
            XSpellAlternatives xAlt = mxSpell.spell( aWord, aLocale, aEmptyProps );
            if (xAlt == null)
                System.out.println( aWord + " is correct." );
            else
            {
                System.out.println( aWord + " is not correct. A list of proposals follows." );
                String[] aAlternatives = xAlt.getAlternatives();
                if (aAlternatives.length == 0)
                    System.out.println( "no proposal found." );
                else
                {
                    for (int i = 0; i < aAlternatives.length; ++i)
View Full Code Here

Examples of com.sun.star.linguistic2.XSpellAlternatives

            bIsCorrect = mxSpell.isValid( aWord, aLocale , aEmptyProps );
            System.out.println( aWord + ": " +  bIsCorrect );   


            aWord = "house";
            XSpellAlternatives xAlt = mxSpell.spell( aWord, aLocale, aEmptyProps );
            if (xAlt == null)
                System.out.println( aWord + " is correct." );
            else
            {
                System.out.println( aWord + " is not correct. A list of proposals follows." );
                String[] aAlternatives = xAlt.getAlternatives();
                if (aAlternatives.length == 0)
                    System.out.println( "no proposal found." );
                else
                {
                    for (int i = 0; i < aAlternatives.length; ++i)
View Full Code Here

Examples of com.sun.star.linguistic2.XSpellAlternatives

        // linguistic is currently not allowed to throw exceptions
        // thus we return null fwhich means 'word cannot be spelled'
        if (!hasLocale( aLocale ))
            return null;
       
        XSpellAlternatives xRes = null;
        if (!isValid( aWord, aLocale, aProperties ))
        {
            xRes = GetProposals( aWord, aLocale, aProperties );
        }
        return xRes;
View Full Code Here

Examples of com.sun.star.linguistic2.XSpellAlternatives

    public void _spell() {
        boolean res = true;
        try {
            log.println("Checking 'original' Spellchecker");
            PropertyValue[] empty = new PropertyValue[0] ;
            XSpellAlternatives alt = oObj.spell(
                            "Summersun",new Locale("en","US",""),empty);
            String alternatives = alt.getAlternatives()[0];
            res = (alternatives != null);
            log.println("Result so far is - "+ (res ? "OK" : "failed"));           
            log.println("Checking alternative Spellchecker");
            alt =alternative.spell(
                            "Summersun",new Locale("en","US",""),empty);
            alternatives = alt.getAlternatives()[0];
            res &= (alternatives != null);
        } catch (com.sun.star.lang.IllegalArgumentException ex) {
            log.println("Exception while checking 'spell'");
            res = false;
            ex.printStackTrace(log);
View Full Code Here

Examples of com.sun.star.linguistic2.XSpellAlternatives

            bIsCorrect = mxSpell.isValid( aWord, aLocale , aEmptyProps );
            System.out.println( aWord + ": " +  bIsCorrect );   


            aWord = "house";
            XSpellAlternatives xAlt = mxSpell.spell( aWord, aLocale, aEmptyProps );
            if (xAlt == null)
                System.out.println( aWord + " is correct." );
            else
            {
                System.out.println( aWord + " is not correct. A list of proposals follows." );
                String[] aAlternatives = xAlt.getAlternatives();
                if (aAlternatives.length == 0)
                    System.out.println( "no proposal found." );
                else
                {
                    for (int i = 0; i < aAlternatives.length; ++i)
View Full Code Here

Examples of com.sun.star.linguistic2.XSpellAlternatives

        // linguistic is currently not allowed to throw exceptions
        // thus we return null fwhich means 'word cannot be spelled'
        if (!hasLocale( aLocale ))
            return null;
       
        XSpellAlternatives xRes = null;
        if (!isValid( aWord, aLocale, aProperties ))
        {
            xRes = GetProposals( aWord, aLocale, aProperties );
        }
        return xRes;
View Full Code Here

Examples of com.sun.star.linguistic2.XSpellAlternatives

    public void _spell() {
        boolean res = true;
        try {
            log.println("Checking 'original' Spellchecker");
            PropertyValue[] empty = new PropertyValue[0] ;
            XSpellAlternatives alt = oObj.spell(
                            "Summersun",new Locale("en","US",""),empty);
            String alternatives = alt.getAlternatives()[0];
            res = (alternatives != null);
            log.println("Result so far is - "+ (res ? "OK" : "failed"));           
            log.println("Checking alternative Spellchecker");
            alt =alternative.spell(
                            "Summersun",new Locale("en","US",""),empty);
            alternatives = alt.getAlternatives()[0];
            res &= (alternatives != null);
        } catch (com.sun.star.lang.IllegalArgumentException ex) {
            log.println("Exception while checking 'spell'");
            res = false;
            ex.printStackTrace(log);
View Full Code Here

Examples of com.sun.star.linguistic2.XSpellAlternatives

            bIsCorrect = mxSpell.isValid( aWord, aLocale , aEmptyProps );
            System.out.println( aWord + ": " +  bIsCorrect );   


            aWord = "house";
            XSpellAlternatives xAlt = mxSpell.spell( aWord, aLocale, aEmptyProps );
            if (xAlt == null)
                System.out.println( aWord + " is correct." );
            else
            {
                System.out.println( aWord + " is not correct. A list of proposals follows." );
                String[] aAlternatives = xAlt.getAlternatives();
                if (aAlternatives.length == 0)
                    System.out.println( "no proposal found." );
                else
                {
                    for (int i = 0; i < aAlternatives.length; ++i)
View Full Code Here

Examples of com.sun.star.linguistic2.XSpellAlternatives

        // linguistic is currently not allowed to throw exceptions
        // thus we return null fwhich means 'word cannot be spelled'
        if (!hasLocale( aLocale ))
            return null;
       
        XSpellAlternatives xRes = null;
        if (!isValid( aWord, aLocale, aProperties ))
        {
            xRes = GetProposals( aWord, aLocale, aProperties );
        }
        return xRes;
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.