7
7
import org.crosswire.jsword.passage.Passage;
10
* The Search Word for a Word to search for. The default
11
* if no other SearchWords match.
13
* <table border='1' cellPadding='3' cellSpacing='0' width="100%">
14
* <tr><td bgColor='white'class='TableRowColor'><font size='-7'>
15
* Distribution Licence:<br />
16
* Project B is free software; you can redistribute it
17
* and/or modify it under the terms of the GNU General Public License,
18
* version 2 as published by the Free Software Foundation.<br />
19
* This program is distributed in the hope that it will be useful,
20
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22
* General Public License for more details.<br />
23
* The License is available on the internet
24
* <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, by writing to
25
* <i>Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
26
* MA 02111-1307, USA</i>, Or locally at the Licence link below.<br />
27
* The copyright to this program is held by it's authors.
28
* </font></td></tr></table>
29
* @see <a href='http://www.eireneh.com/servlets/Web'>Project B Home</a>
30
* @see <{docs.Licence}>
10
* The Search Word for a Word to search for. The default
11
* if no other SearchWords match.
13
* <p><table border='1' cellPadding='3' cellSpacing='0'>
14
* <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
16
* Distribution Licence:<br />
17
* JSword is free software; you can redistribute it
18
* and/or modify it under the terms of the GNU General Public License,
19
* version 2 as published by the Free Software Foundation.<br />
20
* This program is distributed in the hope that it will be useful,
21
* but WITHOUT ANY WARRANTY; without even the implied warranty of
22
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23
* General Public License for more details.<br />
24
* The License is available on the internet
25
* <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, or by writing to:
26
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
27
* MA 02111-1307, USA<br />
28
* The copyright to this program is held by it's authors.
29
* </font></td></tr></table>
31
* @author Joe Walker [joe at eireneh dot com]
33
34
public class GrammarParamWord implements ParamWord
63
64
public Passage getPassage(Engine engine) throws SearchException
65
if (!engine.elements().hasMoreElements())
66
if (!engine.iterator().hasNext())
66
67
throw new SearchException("search_grammar_blank");
70
ParamWord param = (ParamWord) engine.elements().nextElement();
71
ParamWord param = (ParamWord) engine.iterator().next();
71
72
String root = Grammar.getRoot(param.getWord(engine));
72
73
String[] words = BookUtil.toStringArray(engine.getBible().getStartsWith(root));
73
74
return BookUtil.getPassage(engine.getBible(), words);