is Preposition English Word - Java Data Structure

Java examples for Data Structure:English Language

Description

is Preposition English Word

Demo Code


//package com.java2s;

public class Main {
    public static String[] prepositions = { "aboard", "about", "above",
            "across", "after", "against", "along", "amid", "among", "anti",
            "around", "as", "at", "before", "behind", "below", "beneath",
            "beside", "besides", "between", "beyond", "but", "by",
            "concerning", "considering", "despite", "down", "during",
            "except", "excepting", "excluding", "following", "for", "from",
            "in", "inside", "into", "like", "minus", "near", "of", "off",
            "on", "onto", "opposite", "outside", "over", "past", "per",
            "plus", "regarding", "round", "save", "since", "than",
            "through", "to", "toward", "towards", "under", "underneath",
            "unlike", "until", "up", "upon", "versus", "via", "with",
            "within", "without" };

    public static boolean isPreposition(String word) {
        word = word.toLowerCase();/* w w w  .  j av a2 s  .  c om*/
        for (int i = 0; i < prepositions.length; i++) {
            if (prepositions[i].equals(word))
                return true;
        }
        return false;
    }
}

Related Tutorials