public static ObservableCollection<Item> GetRndWords(this FrequencyDictionary fd,int cnt,SpeechParts speechpart_ = null)
        {

            ObservableCollection<Item> coll = new ObservableCollection<Item>();
            Random rnd = new Random();
            for (int i = 0; i < cnt; i++)
            {
                int rndindex = rnd.Next(1, cnt);
                coll.Add(EFDbContext.DataBase.Table<FrequencyDictionary.Item>().FirstOrDefault(x=>x.FrequencyDictionary_id == fd.id && x.Number == rndindex));
            }
            return coll;    
        }
        public static ObservableCollection<Item> GetRndWords(this FrequencyDictionary fd,int cnt,SpeechParts speechpart_ = null)
        {

            ObservableCollection<Item> coll = new ObservableCollection<Item>();
            int maxnumber = EFDbConnect.Main.ExecuteScalar<int>("SELECT count(*) FROM "+FrequencyDictionary.Item.TableName+" WHERE [FrequencyDictionary_id] = "+fd.id.Hex);

            Random rnd = new Random();
            int steps = 0;
            for (int i = 0; i < cnt; i++)
            {
                int rndindex = rnd.Next(1, maxnumber - 1);
                List<FrequencyDictionary.Item> items = EFDbConnect.Main.Query<FrequencyDictionary.Item>(
                    "SELECT * FROM "+FrequencyDictionary.Item.TableName+
                    " WHERE [FrequencyDictionary_id] = "+fd.id.Hex + " AND [Number]="+rndindex);
                if (items.Count == 0) throw new Exception("Frequency dictionary item not found");
                steps++;
                if (steps > 20 + cnt) break;
                if (coll.Contains(items[0])) continue;
                coll.Add(items[0]);
                //coll.Add(EFDbContext.DataBase.Table<FrequencyDictionary.Item>().FirstOrDefault(x=>x.FrequencyDictionary_id == fd.id && x.Number == rndindex));
            }
            return coll;    
        }
 public void AddTranslationWithExternalId(int external_id_,string str_translation,SpeechParts part)
 {
     
     TranslationOfWord translation = translations.Where(x => x.external_id == external_id_).FirstOrDefault();
     if (translation == null)
     {
         translation = new TranslationOfWord();
         translations.Add(translation);
         
     }
     translation.external_id = external_id_;
     translation.Translation = str_translation;
     translation.SpeechPart = part;
     OnPropertyChanged(()=>translation_as_string);
 }