3 new revisions: Revision: cd6a054b49c1 Branch: rt1439-spellCheck Author: Corey Knapp <cknapp.code@xxxxxxxxx> Date: Thu Feb 12 13:44:18 2015 UTC Log: Minor bugfixes https://code.google.com/p/brailleblaster/source/detail?r=cd6a054b49c1 Revision: 249045878b33 Branch: rt1439-spellCheck Author: Corey Knapp <cknapp.code@xxxxxxxxx> Date: Thu Feb 12 13:45:28 2015 UTC Log: Merged default onto rt1439-spellCheck https://code.google.com/p/brailleblaster/source/detail?r=249045878b33 Revision: 6a6ddaaecc74 Branch: rt2091-tPagesGui Author: Corey Knapp <cknapp.code@xxxxxxxxx> Date: Thu Feb 12 18:30:13 2015 UTC Log: Created dialog with Title Page tab https://code.google.com/p/brailleblaster/source/detail?r=6a6ddaaecc74 ============================================================================== Revision: cd6a054b49c1 Branch: rt1439-spellCheck Author: Corey Knapp <cknapp.code@xxxxxxxxx> Date: Thu Feb 12 13:44:18 2015 UTC Log: Minor bugfixes https://code.google.com/p/brailleblaster/source/detail?r=cd6a054b49c1 Modified:/src/main/org/brailleblaster/perspectives/braille/spellcheck/SpellCheckManager.java
/src/main/org/brailleblaster/perspectives/braille/spellcheck/Tokenizer.java =======================================--- /src/main/org/brailleblaster/perspectives/braille/spellcheck/SpellCheckManager.java Wed Feb 11 17:37:06 2015 UTC +++ /src/main/org/brailleblaster/perspectives/braille/spellcheck/SpellCheckManager.java Thu Feb 12 13:44:18 2015 UTC
@@ -70,8 +70,14 @@String [] suggestions = sc.getSuggestions(tokenizer.getCurrentWord()); if(tokenizer.getSplitPos()!=0){ //Caught a word that probably needs a space
String word1, word2; + String punc = ".?!";word1 = tokenizer.getCurrentWord().substring(0, tokenizer.getSplitPos()); - word2 = tokenizer.getCurrentWord().substring(tokenizer.getSplitPos()); + if(punc.contains(Character.toString(tokenizer.getCurrentWord().charAt(tokenizer.getSplitPos()- 1)))){ + //If we're splitting a word at a . ! or ? the second word should be capitalized. + word2 = Character.toUpperCase(tokenizer.getCurrentWord().charAt(tokenizer.getSplitPos())) + tokenizer.getCurrentWord().substring(tokenizer.getSplitPos()+1);
+ } else {+ word2 = tokenizer.getCurrentWord().substring(tokenizer.getSplitPos());
+ }// Make a new suggestions array that includes existing words with space
String[] newSuggestions = new String[suggestions.length+1]; newSuggestions[0] = word1 + " " + word2; @@ -90,7 +96,7 @@ tokenizer.setCapFlag(false); } } - } + } } if(tokenizer.isComplete()) { =======================================--- /src/main/org/brailleblaster/perspectives/braille/spellcheck/Tokenizer.java Wed Feb 11 17:37:06 2015 UTC +++ /src/main/org/brailleblaster/perspectives/braille/spellcheck/Tokenizer.java Thu Feb 12 13:44:18 2015 UTC
@@ -38,7 +38,7 @@while(endPos < text.length() && ((Character.isLetter(text.charAt(endPos))|| Character.isDigit(text.charAt(endPos))) || text.charAt(endPos) == '\'')){
endPos++; - if(endPos < text.length()){ + if(endPos+2 < text.length()){if(punctuation.contains(Character.toString(text.charAt(endPos)))){ //We are at a punctuation mark.
if(text.charAt(endPos+1) != ' '){ //If the next character isn't a space, something might be wrong @@ -54,7 +54,7 @@} else { //If it is a space, the following character needs to be capitalized if(sentenceEnd.contains(Character.toString(text.charAt(endPos)))){ //Make sure it isn't a comma
if(Character.isLowerCase(text.charAt(endPos+2))){ - capFlag = true; + capFlag = true; } } } ============================================================================== Revision: 249045878b33 Branch: rt1439-spellCheck Author: Corey Knapp <cknapp.code@xxxxxxxxx> Date: Thu Feb 12 13:45:28 2015 UTC Log: Merged default onto rt1439-spellCheck https://code.google.com/p/brailleblaster/source/detail?r=249045878b33 ============================================================================== Revision: 6a6ddaaecc74 Branch: rt2091-tPagesGui Author: Corey Knapp <cknapp.code@xxxxxxxxx> Date: Thu Feb 12 18:30:13 2015 UTC Log: Created dialog with Title Page tab https://code.google.com/p/brailleblaster/source/detail?r=6a6ddaaecc74 Modified: /src/main/org/brailleblaster/perspectives/braille/Manager.java /src/main/org/brailleblaster/perspectives/braille/ui/BrailleMenu.java =======================================--- /src/main/org/brailleblaster/perspectives/braille/Manager.java Thu Feb 12 14:09:13 2015 UTC +++ /src/main/org/brailleblaster/perspectives/braille/Manager.java Thu Feb 12 18:30:13 2015 UTC
@@ -76,6 +76,7 @@ import org.brailleblaster.perspectives.braille.stylers.TextUpdateHandler; import org.brailleblaster.perspectives.braille.stylers.WhiteSpaceHandler; import org.brailleblaster.search.*; +import org.brailleblaster.tpages.TPagesDialog; import org.brailleblaster.perspectives.braille.viewInitializer.ViewFactory;import org.brailleblaster.perspectives.braille.viewInitializer.ViewInitializer;
import org.brailleblaster.perspectives.braille.views.tree.BBTree; @@ -126,6 +127,7 @@ private MapList list; private QueueManager queueManager; SearchDialog srch = null; + TPagesDialog tpDialog = null; private Vector<String> ignoreList = new Vector<String>(); //Constructor that sets things up for a new document. @@ -324,6 +326,11 @@ srch.openWithPreviousValues(); } + } + + public void tPages(){ + tpDialog = new TPagesDialog(wp.getShell(), SWT.NONE, this); + tpDialog.open(); } public void fileSave(){ =======================================--- /src/main/org/brailleblaster/perspectives/braille/ui/BrailleMenu.java Tue Feb 10 20:40:47 2015 UTC +++ /src/main/org/brailleblaster/perspectives/braille/ui/BrailleMenu.java Thu Feb 12 18:30:13 2015 UTC
@@ -80,6 +80,7 @@ MenuItem displayedGraphicItem; MenuItem tableItem; MenuItem insertTRItem; + MenuItem insertTPagesItem; MenuItem brlFormatItem; MenuItem showTranslationTemplatesItem; MenuItem showFormatTemplatesItem; @@ -728,6 +729,14 @@ public void widgetSelected(SelectionEvent e) { currentEditor.insertTranscriberNote(); } + }); + insertTPagesItem = new MenuItem(insertMenu, SWT.PUSH); + insertTPagesItem.setText("Transcriber-Generated Pages..."); + insertTPagesItem.addSelectionListener(new SelectionAdapter(){ + @Override + public void widgetSelected(SelectionEvent e){ + currentEditor.tPages(); + } }); /* inLineMathItem = new MenuItem(insertMenu, SWT.PUSH);