forked from GitHub/gf-core
*** empty log message ***
This commit is contained in:
@@ -152,11 +152,11 @@ oper
|
|||||||
npGenDet : Number -> Numeral -> NounPhrase -> CommNounPhrase -> NounPhrase =
|
npGenDet : Number -> Numeral -> NounPhrase -> CommNounPhrase -> NounPhrase =
|
||||||
\n,dva, masha,mashina ->
|
\n,dva, masha,mashina ->
|
||||||
{s = \\c => case masha.pron of
|
{s = \\c => case masha.pron of
|
||||||
{ True => masha.s ! (mkPronForm Nom No (Poss (gNum mashina.g n))) ++
|
{ True => masha.s ! (mkPronForm (extCase c) No (Poss (gNum mashina.g n))) ++
|
||||||
dva.s ! Nom ! mashina.g ++ mashina.s ! n ! (extCase c) ;
|
dva.s ! (extCase c) ! mashina.g ++ mashina.s ! n ! (extCase c) ;
|
||||||
False => masha.s ! (mkPronForm Gen No (Poss (gNum mashina.g n))) ++
|
False => dva.s ! (extCase c) ! mashina.g ++ mashina.s ! n ! (extCase c) ++
|
||||||
dva.s ! Nom ! 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
|
n = n ; p = P3 ; g = mashina.g ; anim = mashina.anim ; pron = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener,
|
|||||||
public MouseEvent m2;
|
public MouseEvent m2;
|
||||||
public static String selectedText="";
|
public static String selectedText="";
|
||||||
|
|
||||||
public static boolean debug = false;
|
public static boolean debug = true;
|
||||||
public static boolean debug3 = false;
|
public static boolean debug3 = false;
|
||||||
public static boolean debug2 = false;
|
public static boolean debug2 = true;
|
||||||
public static boolean selectionCheck = false;
|
public static boolean selectionCheck = false;
|
||||||
public static String focusPosition = "";
|
public static String focusPosition = "";
|
||||||
public static String stringToAppend = "";
|
public static String stringToAppend = "";
|
||||||
@@ -692,11 +692,14 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener,
|
|||||||
//form lang and Menu menu:
|
//form lang and Menu menu:
|
||||||
cbMenuItem = new JCheckBoxMenuItem(result.substring(4));
|
cbMenuItem = new JCheckBoxMenuItem(result.substring(4));
|
||||||
if (debug) System.out.println ("menu item: "+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.setActionCommand("lang");
|
||||||
cbMenuItem.addActionListener(myListener);
|
cbMenuItem.addActionListener(myListener);
|
||||||
langMenu.add(cbMenuItem);
|
langMenu.add(cbMenuItem);
|
||||||
/* if ((result.substring(4)).equals("Abstract"))
|
/*
|
||||||
{
|
{
|
||||||
submenu.add(rbMenuItemAbs);
|
submenu.add(rbMenuItemAbs);
|
||||||
if (selectedMenuLanguage.equals("Abstract"))
|
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:
|
// in case focus tag is cut into two lines:
|
||||||
if (l==-1) l=l2-7;
|
if (l==-1) l=l2-7;
|
||||||
m=result.indexOf("position",l);
|
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);
|
n=result.indexOf("]",m);
|
||||||
if (debug2) System.out.println("POSITION END: "+n);
|
if (debug2) System.out.println("POSITION END: "+n);
|
||||||
if (debug)
|
if (debug)
|
||||||
@@ -802,7 +805,7 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener,
|
|||||||
result= result.substring(0,i-1)+result.substring(j+2);
|
result= result.substring(0,i-1)+result.substring(j+2);
|
||||||
else
|
else
|
||||||
result= result.substring(0,i-2)+result.substring(j+1);
|
result= result.substring(0,i-2)+result.substring(j+1);
|
||||||
j= result.indexOf("<focus");
|
j= result.indexOf("<focus");
|
||||||
l2 = result.indexOf("focus");
|
l2 = result.indexOf("focus");
|
||||||
// in case focus tag is cut into two lines:
|
// in case focus tag is cut into two lines:
|
||||||
if ((l2!=-1)&&(j==-1)) j=l2-7;
|
if ((l2!=-1)&&(j==-1)) j=l2-7;
|
||||||
@@ -1634,6 +1637,10 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener,
|
|||||||
{
|
{
|
||||||
if (debug2)
|
if (debug2)
|
||||||
System.out.println("STRING: "+s);
|
System.out.println("STRING: "+s);
|
||||||
|
if (debug2)
|
||||||
|
System.out.println("where selection start is: "+selectionStart);
|
||||||
|
if (debug2)
|
||||||
|
System.out.println("where selection end is: "+selectionEnd);
|
||||||
currentLength = 0;
|
currentLength = 0;
|
||||||
newLength=0;
|
newLength=0;
|
||||||
oldLength = output.getText().length();
|
oldLength = output.getText().length();
|
||||||
@@ -1641,13 +1648,14 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener,
|
|||||||
restString = s;
|
restString = s;
|
||||||
int m2, m1;
|
int m2, m1;
|
||||||
String position = "";
|
String position = "";
|
||||||
if ((selectionStart>-1)&&(selectionEnd>selectionStart))
|
// if ((selectionStart>-1)&&(selectionEnd>=selectionStart))
|
||||||
|
if (selectionStart>-1)
|
||||||
{
|
{
|
||||||
selStart = selectionStart;
|
selStart = selectionStart;
|
||||||
selEnd = selectionEnd;
|
selEnd = selectionEnd;
|
||||||
//if (debug2)
|
if (debug2)
|
||||||
System.out.println("SELECTION: " + selStart + " "+selEnd+ "TOTAL: "+s.length());
|
System.out.println("SELECTION: " + selStart + " "+selEnd+ "TOTAL: "+s.length());
|
||||||
if (selEnd>-1)
|
if (selEnd>selStart)
|
||||||
selectionCheck = (s.substring(selStart, selEnd).indexOf("<")==-1);
|
selectionCheck = (s.substring(selStart, selEnd).indexOf("<")==-1);
|
||||||
l = restString.indexOf("<subtree");
|
l = restString.indexOf("<subtree");
|
||||||
l2 = restString.indexOf("</subtree");
|
l2 = restString.indexOf("</subtree");
|
||||||
@@ -1739,7 +1747,7 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener,
|
|||||||
//System.out.println(" STRING: "+restString.substring(currentLength));
|
//System.out.println(" STRING: "+restString.substring(currentLength));
|
||||||
}
|
}
|
||||||
} //while
|
} //while
|
||||||
if ((selEnd>-1)&&(outputVector.size()>0))
|
if ((selEnd>=selStart)&&(outputVector.size()>0))
|
||||||
{
|
{
|
||||||
// exclamation sign etc.:
|
// exclamation sign etc.:
|
||||||
if (currentLength>selEnd)
|
if (currentLength>selEnd)
|
||||||
@@ -1763,9 +1771,34 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} //if selectionStart>-1
|
} //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("</subtree>");
|
||||||
|
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("</subtree>");
|
||||||
|
}
|
||||||
|
r = restString.indexOf("<subtree");
|
||||||
|
while (r>-1)
|
||||||
|
{
|
||||||
|
int t = restString.indexOf(">",r);
|
||||||
|
if (t<restString.length()-2)
|
||||||
|
restString = restString.substring(0,r)+restString.substring(t+2);
|
||||||
|
else
|
||||||
|
restString = restString.substring(0,r);
|
||||||
|
r = restString.indexOf("<subtree");
|
||||||
|
}
|
||||||
|
}
|
||||||
// appending:
|
// appending:
|
||||||
output.append(restString);
|
output.append(restString);
|
||||||
if (selectionEnd>-1)
|
if ((selectionEnd>=selectionStart)&&(selectionStart>-1))
|
||||||
try {
|
try {
|
||||||
output.getHighlighter().addHighlight(selStart+oldLength, selEnd+oldLength+1, new DefaultHighlighter.DefaultHighlightPainter(Color.green) );
|
output.getHighlighter().addHighlight(selStart+oldLength, selEnd+oldLength+1, new DefaultHighlighter.DefaultHighlightPainter(Color.green) );
|
||||||
selectedText = output.getText().substring(selStart+oldLength, selEnd+oldLength+1);
|
selectedText = output.getText().substring(selStart+oldLength, selEnd+oldLength+1);
|
||||||
|
|||||||
Reference in New Issue
Block a user