Beispiel #1
0
	public void Read ()
        {
            string keywords, spanto, sdelim, edelim, signore;
            ArrayList stylesList = new ArrayList();
            ArrayList patternsList = new ArrayList();
	    Style style;

            string names = (string) gconf.Get (GCONF_PATH + "styles");

            foreach (string name in names.Split(' ')) {
		    if (name.Length == 0)
			    continue;

		    keywords = (string) gconf.Get (GCONF_PATH + name + "/keywords");

		    style = new Style (GCONF_PATH + name);
		    stylesList.Add (style);

		    sdelim   = (string) gconf.Get (GCONF_PATH + name + "/sdelim");
		    edelim   = (string) gconf.Get (GCONF_PATH + name + "/edelim");

		    try {
			    signore  = (string) gconf.Get (GCONF_PATH + name + "/signore");
		    } catch (NoSuchKeyException e) {
			    signore  = null;
		    }

		    try  {
			    spanto = (string) gconf.Get (GCONF_PATH + name + "/spanto");
		    } catch (NoSuchKeyException e)  {
			    spanto = null;
		    }

		    foreach (string key in keywords.Split(' '))
		            patternsList.Add (new Pattern (style, GCONF_PATH + name, key, spanto, sdelim, edelim, signore));
            }

            patterns = (Pattern[]) patternsList.ToArray (typeof (Pattern));
	    styles = (Style[]) stylesList.ToArray  (typeof (Style));
        }
Beispiel #2
0
	public Token (Pattern pattern, int sidx, int eidx)
	{
	    this.sindex = sidx - pattern.pattern.Length + 1;
	    this.eindex = eidx + 1;
	    this.style  = pattern.style;
	}