public static ArrayList sentenceSplit(ArrayList arraylist, String s)
    {
        ArrayList arraylist1 = new ArrayList();
        int i = s.length();
        if(i == 0)
        {
            arraylist1.add("");
            return arraylist1;
        }
        ArrayList arraylist2 = new ArrayList();
        for(Iterator iterator = arraylist.iterator(); iterator.hasNext();)
        {
            String s1 = (String)iterator.next();
            for(int j = s.indexOf(s1); j != -1; j = s.indexOf(s1, j + 1))
                arraylist2.add(new Integer(j));

        }

        if(arraylist2.size() == 0)
        {
            arraylist1.add(s);
            return arraylist1;
        }
        Collections.sort(arraylist2);
        ListIterator listiterator = arraylist2.listIterator();
        int l;
        for(int k = ((Integer)listiterator.next()).intValue(); listiterator.hasNext(); k = l)
        {
            l = ((Integer)listiterator.next()).intValue();
            if(l == k + 1)
            {
                listiterator.previous();
                listiterator.previous();
                listiterator.remove();
            }
        }

        listiterator = arraylist2.listIterator();
        int i1 = 0;
        int j1 = i - 1;
        while(listiterator.hasNext()) 
        {
            int k1 = ((Integer)listiterator.next()).intValue();
            arraylist1.add(s.substring(i1, k1 + 1).trim());
            i1 = k1 + 1;
        }
        if(i1 < i - 1)
            arraylist1.add(s.substring(i1).trim());
        return arraylist1;
    }