예제 #1
0
 public void OnPrune(PruneType Prune)
 {
     Live.Clear();
     Dead.Clear();
     Number           = 0;
     _ReadyForHarvest = false;
 }
예제 #2
0
        private void OnPrune(PruneType Prune)
        {
            Summary.WriteMessage(this, "Pruning");

            Live.Clear();
            Dead.Clear();
        }
예제 #3
0
        public WordMapper(List <string> dictionary, PruneType pruneType)
        {
            if (dictionary == null)
            {
                _dictionary = new List <string>();
            }
            _dictionary = dictionary;

            _pruneType = pruneType;
            _suffixer  = new PersianSuffixLemmatizer(true, false);
        }
예제 #4
0
    public void OnPrune(PruneType Prune)
    {
        string Indent = "     ";
        string Title  = Indent + Clock.Today.ToString("d MMMM yyyy") + "  - Pruning " + Name + " from " + Plant.Name;

        Console.WriteLine("");
        Console.WriteLine(Title);
        Console.WriteLine(Indent + new string('-', Title.Length));

        Live.Clear();
        Dead.Clear();
    }
예제 #5
0
        public PinglishMapping(string mappingFileName, string dicPath, PruneType pruneType)
        {
            try
            {
                List <PinglishString> list = PinglishConverterUtils.LoadPinglishStrings(mappingFileName);
                Learn(list, false);
                m_pinglishDataSet.AddRange(list.RemoveDuplicates());

                _suffixer = new PersianSuffixLemmatizer(true);
                Tools.LoadList(ref _dic, dicPath);
                _wordMapper = new WordMapper(_dic, pruneType);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
        }
예제 #6
0
        public PinglishConverter(PinglishConverterConfig config, PruneType pruneType, bool supportTranslating)
        {
            if (supportTranslating)
            {
                throw new NotImplementedException("Currently not supported");
            }

            ReadExceptionWords(config.ExceptionWordDicPath);
            _preProcessor = new PreProcessor();

            // TODO: Translation is not supported for now
            _translator = supportTranslating ? new Translator(config.EnToPeDicPath) : new Translator();

            if (PruneType.Stem == pruneType)
            {
                _transliterater = new PinglishMapping(config.XmlDataPath, config.StemDicPath, pruneType);
            }
            else
            {
                _transliterater = new PinglishMapping(config.XmlDataPath, config.GoftariDicPath, pruneType);
            }
        }
예제 #7
0
 private readonly ITransliterator _transliterater;          //this present Transliterator Object
 public PinglishConverter(PinglishConverterConfig config, PruneType pruneType) : this(config, pruneType, false)
 {
 }
예제 #8
0
파일: Leaf.cs 프로젝트: byzheng/ApsimX
 private void OnPrune(PruneType Prune)
 {
     Structure.PrimaryBudNo = Prune.BudNumber;
     ZeroLeaves();
 }
예제 #9
0
 public void OnPrune(PruneType Prune)
 {
     Structure.PrimaryBudNo = Prune.BudNumber;
     CohortsInitialised     = false;
     ZeroLeaves();
 }
예제 #10
0
        public static bool IsValidInDictionary(string word, List <string> dic, PersianSuffixLemmatizer suffixer, PruneType prouneType)
        {
            if (PruneType.NoPrune == prouneType)
            {
                return(false);
            }

            if (dic.Contains(word))
            {
                return(true);
            }
            else if (PruneType.Stem == prouneType)
            {
                ReversePatternMatcherPatternInfo[] inf = suffixer.MatchForSuffix(word);
                foreach (ReversePatternMatcherPatternInfo info in inf)
                {
                    if (dic.Contains(info.BaseWord))
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }