package com.yagadi.enguage.expression;

import com.yagadi.enguage.sofa.Variable;
import com.yagadi.enguage.util.Audit;
import com.yagadi.enguage.util.Strings;

public class Fmt {
	/** Fmt:
	 * e.g. ["Ok", ",", "you", "need", "..."]
	 */
	
	static private Audit audit = new Audit( "Fmt" );
	
	private boolean shrt = false;
	public  boolean shrt() { return shrt; }
	public  void    shrt( boolean b ) { shrt = b; }
	
	private boolean v = false;
	public  boolean variable() {return v;}
	
	private Strings ormat = new Strings();
	/*private Strings format() {
		if (!verbose()) {
			if (f.ormat().size() > 1 && f.ormat().get( 1 ).equals( "," ))
				if (f.ormat().get( 0 ).equalsIgnoreCase( yes ) || // yes is set to "OK", when yes is "yes", this fails...
					f.ormat().get( 0 ).equalsIgnoreCase(  no ) ||
					f.ormat().get( 0 ).equalsIgnoreCase( success )) {
					return new Strings( say() + " " +f.ormat().get( 0 ));
				} else if (f.ormat().get( 0 ).equalsIgnoreCase( failure )) {
					return new Strings( say()).append( f.ormat().copyAfter( 1 ).filter()); // forget 1st & 2nd
				}
			return new Strings( say()).append( f.ormat().filter( ));
		}
		return f.ormat( );
	}*/
	public  Strings ormat() {return ormat;}
	public  void    ormat(String s) {
		ormat = Colloquial.applyOutgoing(
					Context.deref(
						Variable.deref(
							new Strings( s )
				)	)	);		
		if (ormat.contains("...")) v = true;
	}
	static public void main( String args[] ) {
		Fmt f = new Fmt();
		f.ormat( "SUBJECT needs ..." );
		audit.log( "fmt: "+ f.ormat());
}	}

@@ -522,17 +522,15 @@
 );%0A%09
-/*private
+public 
  Str
@@ -534,17 +534,16 @@
 Strings 
-f
 ormat() 
@@ -550,22 +550,18 @@
 %7B%0A%09%09
+/*
 if (
-!verbose()
+shrt
 ) %7B%0A
@@ -563,26 +563,24 @@
 t) %7B%0A%09%09%09if (
-f.
 ormat().size
@@ -589,18 +589,16 @@
  %3E 1 && 
-f.
 ormat().
@@ -625,26 +625,24 @@
  ))%0A%09%09%09%09if (
-f.
 ormat().get(
@@ -730,26 +730,24 @@
 ils...%0A%09%09%09%09%09
-f.
 ormat().get(
@@ -783,18 +783,16 @@
 %7C%7C%0A%09%09%09%09%09
-f.
 ormat().
@@ -847,36 +847,8 @@
 urn 
-new Strings( say() + %22 %22 +f.
 orma
@@ -877,18 +877,16 @@
 lse if (
-f.
 ormat().
@@ -941,38 +941,8 @@
 urn 
-new Strings( say()).append( f.
 orma
@@ -968,17 +968,16 @@
 filter()
-)
 ; // for
@@ -1010,38 +1010,8 @@
 urn 
-new Strings( say()).append( f.
 orma
@@ -1025,16 +1025,16 @@
 ter(
- )
 );%0A%09%09%7D
+*/
 %0A%09%09r
@@ -1043,64 +1043,16 @@
 urn 
-f.
 ormat
-( );%0A%09%7D*/%0A%09public  Strings ormat() %7Breturn ormat;
+;%0A%09
 %7D%0A%09p

Tidy - Fmt, won't work with short option, but working on it...