diff --git a/lib/resource-0.6/russian/SyntaxRus.gf b/lib/resource-0.6/russian/SyntaxRus.gf index 28a84cb78..a4ec86939 100644 --- a/lib/resource-0.6/russian/SyntaxRus.gf +++ b/lib/resource-0.6/russian/SyntaxRus.gf @@ -152,11 +152,11 @@ oper npGenDet : Number -> Numeral -> NounPhrase -> CommNounPhrase -> NounPhrase = \n,dva, masha,mashina -> {s = \\c => case masha.pron of - { True => masha.s ! (mkPronForm Nom No (Poss (gNum mashina.g n))) ++ - dva.s ! Nom ! mashina.g ++ mashina.s ! n ! (extCase c) ; - False => masha.s ! (mkPronForm Gen No (Poss (gNum mashina.g n))) ++ - dva.s ! Nom ! mashina.g ++ mashina.s ! n ! (extCase c) - } ; + { True => masha.s ! (mkPronForm (extCase c) No (Poss (gNum mashina.g n))) ++ + dva.s ! (extCase c) ! mashina.g ++ mashina.s ! n ! (extCase c) ; + False => dva.s ! (extCase c) ! mashina.g ++ mashina.s ! n ! (extCase c) ++ + masha.s ! (mkPronForm Gen No (Poss (gNum mashina.g n))) + } ; n = n ; p = P3 ; g = mashina.g ; anim = mashina.anim ; pron = False } ; diff --git a/src/JavaGUI/GFEditor2.java b/src/JavaGUI/GFEditor2.java index 1f8fcea60..4aac5d880 100644 --- a/src/JavaGUI/GFEditor2.java +++ b/src/JavaGUI/GFEditor2.java @@ -21,9 +21,9 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener, public MouseEvent m2; public static String selectedText=""; - public static boolean debug = false; + public static boolean debug = true; public static boolean debug3 = false; - public static boolean debug2 = false; + public static boolean debug2 = true; public static boolean selectionCheck = false; public static String focusPosition = ""; public static String stringToAppend = ""; @@ -692,11 +692,14 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener, //form lang and Menu menu: cbMenuItem = new JCheckBoxMenuItem(result.substring(4)); if (debug) System.out.println ("menu item: "+result.substring(4)); - cbMenuItem.setSelected(true); + if ((result.substring(4)).equals("Abstract")) + cbMenuItem.setSelected(false); + else + cbMenuItem.setSelected(true); cbMenuItem.setActionCommand("lang"); cbMenuItem.addActionListener(myListener); langMenu.add(cbMenuItem); -/* if ((result.substring(4)).equals("Abstract")) +/* { submenu.add(rbMenuItemAbs); if (selectedMenuLanguage.equals("Abstract")) @@ -770,7 +773,7 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener, // in case focus tag is cut into two lines: if (l==-1) l=l2-7; m=result.indexOf("position",l); - if (debug2) System.out.println("'POSITION START: "+m); + if (debug2) System.out.println("POSITION START: "+m); n=result.indexOf("]",m); if (debug2) System.out.println("POSITION END: "+n); if (debug) @@ -802,7 +805,7 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener, result= result.substring(0,i-1)+result.substring(j+2); else result= result.substring(0,i-2)+result.substring(j+1); - j= result.indexOf("-1)&&(selectionEnd>selectionStart)) +// if ((selectionStart>-1)&&(selectionEnd>=selectionStart)) + if (selectionStart>-1) { selStart = selectionStart; selEnd = selectionEnd; - //if (debug2) + if (debug2) System.out.println("SELECTION: " + selStart + " "+selEnd+ "TOTAL: "+s.length()); - if (selEnd>-1) + if (selEnd>selStart) selectionCheck = (s.substring(selStart, selEnd).indexOf("<")==-1); l = restString.indexOf("-1)&&(outputVector.size()>0)) + if ((selEnd>=selStart)&&(outputVector.size()>0)) { // exclamation sign etc.: if (currentLength>selEnd) @@ -1763,9 +1771,34 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener, } } } //if selectionStart>-1 + else + { + System.out.println("NO SELECTION IN THE TEXT TO BE APPENDED!"); + //cutting tags from previous focuses if any: + int r = restString.indexOf(""); + while (r>-1) + { + // check if punktualtion marks like . ! ? are at the end of a sentence: + if (restString.charAt(r+10)==' ') + restString = restString.substring(0,r)+restString.substring(r+11); + else + restString = restString.substring(0,r)+restString.substring(r+10); + r = restString.indexOf(""); + } + r = restString.indexOf("-1) + { + int t = restString.indexOf(">",r); + if (t-1) + if ((selectionEnd>=selectionStart)&&(selectionStart>-1)) try { output.getHighlighter().addHighlight(selStart+oldLength, selEnd+oldLength+1, new DefaultHighlighter.DefaultHighlightPainter(Color.green) ); selectedText = output.getText().substring(selStart+oldLength, selEnd+oldLength+1);