Changeset 292
- Timestamp:
- 05/19/08 22:41:59 (8 months ago)
- Files:
-
- lex/trunk/jsp/search.jsp (modified) (3 diffs)
- lex/trunk/test/com/qwirx/lex/SearchTest.java (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lex/trunk/jsp/search.jsp
r255 r292 144 144 from the set: 145 145 </p> 146 <%147 String latin = ">BGDHWZXVJKLMNS<PYQRFCT";148 String hebrew = HebrewConverter.toHebrew(latin);149 String trans = HebrewConverter.toTranslit(latin);150 %>151 146 <table class="grid"> 152 147 <tr> 153 148 <th>Consonants</th> 154 149 <% 150 String latin = ">BGDHWZXVJKLMNS<PYQRFCT"; 151 155 152 for (int i = 0; i < latin.length() ; i++) 156 153 { … … 165 162 <th>Hebrew</th> 166 163 <% 167 for (int i = 0; i < hebrew.length(); i++)164 for (int i = 0; i < latin.length() ; i++) 168 165 { 169 String c = hebrew.substring(i, i + 1); 166 String c = latin.substring(i, i + 1); 167 String h = HebrewConverter.toHebrew(c); 170 168 %> 171 <td class="hebrew"><%= c%></td>169 <td class="hebrew"><%= h %></td> 172 170 <% 173 171 } … … 177 175 <th>Transliteration</th> 178 176 <% 179 for (int i = 0; i < trans.length(); i++)177 for (int i = 0; i < latin.length() ; i++) 180 178 { 181 String c = trans.substring(i, i + 1); 179 String c = latin.substring(i, i + 1); 180 String h = HebrewConverter.toTranslit(c); 182 181 %> 183 <td><%= c%></td>182 <td><%= h %></td> 184 183 <% 185 184 } lex/trunk/test/com/qwirx/lex/SearchTest.java
r259 r292 235 235 i.assertStart("h1"); 236 236 i.assertText("Lex"); 237 i.assertStart(" font",237 i.assertStart("span", 238 238 new Attributes().style("font-size: medium")); 239 239 i.assertText("by"); 240 240 i.assertSimple("a", "Chris Wilson", 241 241 new Attributes().href("http://www.qwirx.com")); 242 i.assertEnd(" font");242 i.assertEnd("span"); 243 243 i.assertEnd("h1"); 244 244 … … 270 270 new Attributes().clazz("dump_jsp").href("dump.jsp")); 271 271 */ 272 i.assertSimple("a", "Wordnet", 273 new Attributes().clazz("wordnet_jsp").href("wordnet.jsp")); 272 274 i.assertSimple("a", "Login", 273 275 new Attributes().clazz("login_jsp").href("login.jsp?next=search.jsp")); … … 278 280 279 281 i.assertStart("form", new Attributes().method("GET").clazz("bigborder")); 280 i.assertSimple("p", "S earch for Hebrew word by root" +281 " (surface consonants):");282 i.assertSimple("p", "Simple search (enter surface consonants " + 283 "for a Hebrew word):"); 282 284 i.assertStart("p"); 283 285 i.assertEmpty("input", new Attributes().name("q")); 284 286 i.assertEmpty("input", new Attributes().type("submit").value("Search")); 285 287 i.assertEnd("p"); 288 289 i.assertEmpty("hr"); 290 291 i.assertSimple("p", "Advanced search (enter an MQL query to nest " + 292 "within [clause]):"); 293 i.assertStart("p"); 294 i.assertEmpty("input", new Attributes().name("aq").add("size", "40")); 295 i.assertSubmit("advanced", "Search"); 296 i.assertEnd("p"); 297 298 i.assertEmpty("hr"); 299 300 i.assertStart("div", 301 new Attributes().add("id", "simple_adv_div").clazz("advanced")); 302 286 303 i.assertStart("p"); 287 304 i.assertEmpty("input", new Attributes().type("checkbox") … … 320 337 i.assertStart("tr"); 321 338 i.assertSimple("th", "Hebrew"); 322 for (int j = 0; j < hebrew.length(); j++) 323 { 324 String c = hebrew.substring(j, j + 1); 325 i.assertSimple("td", c); 339 for (int j = 0; j < latin.length(); j++) 340 { 341 String c = latin.substring(j, j + 1); 342 String h = HebrewConverter.toHebrew(c); 343 i.assertSimple("td", h, new Attributes().clazz("hebrew")); 326 344 } 327 345 i.assertEnd("tr"); … … 329 347 i.assertStart("tr"); 330 348 i.assertSimple("th", "Transliteration"); 331 for (int j = 0; j < trans.length(); j++) 332 { 333 String c = trans.substring(j, j + 1); 334 i.assertSimple("td", c); 349 for (int j = 0; j < latin.length(); j++) 350 { 351 String c = latin.substring(j, j + 1); 352 String h = HebrewConverter.toTranslit(c); 353 i.assertSimple("td", h); 335 354 } 336 355 i.assertEnd("tr"); 337 356 338 357 i.assertEnd("table"); 358 i.assertEnd("div", new Attributes().clazz("advanced")); 359 360 i.assertStart("div"); 361 i.assertInput("simple_adv_btn", "Advanced Options ") 362 .assertAttribute("type", "button") 363 .assertAttribute("onclick", "toggle(this, 'simple_adv_div')"); 364 i.assertEnd("div"); 339 365 i.assertEnd("form"); 340 366 … … 346 372 i.assertSimple("a", "Lex Project", 347 373 new Attributes().href("http://rrg.qwirx.com/trac/lex")); 348 i.assertText("2005-200 7.");374 i.assertText("2005-2008."); 349 375 i.assertEnd("p"); 350 376 i.assertEnd("body");
