예제 #1
0
        private void SetupFactoriesAndRepositories()
        {
            Assert.True(Cache != null, "No cache yet!?");
            var servLoc = Cache.ServiceLocator;

            m_possFact  = servLoc.GetInstance <ICmPossibilityFactory>();
            m_possRepo  = servLoc.GetInstance <ICmPossibilityRepository>();
            m_posFact   = servLoc.GetInstance <IPartOfSpeechFactory>();
            m_posRepo   = servLoc.GetInstance <IPartOfSpeechRepository>();
            m_entryFact = servLoc.GetInstance <ILexEntryFactory>();
            m_senseFact = servLoc.GetInstance <ILexSenseFactory>();
            m_stemFact  = servLoc.GetInstance <IMoStemAllomorphFactory>();
            m_affixFact = servLoc.GetInstance <IMoAffixAllomorphFactory>();
        }
예제 #2
0
        private void EnsureFactoryForClass(string sClassName)
        {
            switch (sClassName)
            {
            case "CmPossibility":
                if (m_factPoss == null)
                {
                    m_factPoss = m_cache.ServiceLocator.GetInstance <ICmPossibilityFactory>();
                }
                break;

            case "CmAnthroItem":
                if (m_factAnthro == null)
                {
                    m_factAnthro = m_cache.ServiceLocator.GetInstance <ICmAnthroItemFactory>();
                }
                break;

            case "CmSemanticDomain":
                if (m_factSemDom == null)
                {
                    m_factSemDom = m_cache.ServiceLocator.GetInstance <ICmSemanticDomainFactory>();
                }
                break;

            case "CmDomainQ":
                if (m_factCmDomainQ == null)
                {
                    m_factCmDomainQ = m_cache.ServiceLocator.GetInstance <ICmDomainQFactory>();
                }
                break;

            case "PartOfSpeech":
                if (m_factPOS == null)
                {
                    m_factPOS = m_cache.ServiceLocator.GetInstance <IPartOfSpeechFactory>();
                }
                break;

            default:
                // TODO: implement the other subclasses of CmPossibility.
                throw new NotImplementedException();
            }
        }
예제 #3
0
		private void EnsureFactoryForClass(string sClassName)
		{
			switch (sClassName)
			{
				case "CmPossibility":
					if (m_factPoss == null)
						m_factPoss = m_cache.ServiceLocator.GetInstance<ICmPossibilityFactory>();
					break;
				case "CmAnthroItem":
					if (m_factAnthro == null)
						m_factAnthro = m_cache.ServiceLocator.GetInstance<ICmAnthroItemFactory>();
					break;
				case "CmSemanticDomain":
					if (m_factSemDom == null)
						m_factSemDom = m_cache.ServiceLocator.GetInstance<ICmSemanticDomainFactory>();
					break;
				case "CmDomainQ":
					if (m_factCmDomainQ == null)
						m_factCmDomainQ = m_cache.ServiceLocator.GetInstance<ICmDomainQFactory>();
					break;
				case "PartOfSpeech":
					if (m_factPOS == null)
						m_factPOS = m_cache.ServiceLocator.GetInstance<IPartOfSpeechFactory>();
					break;
				default:
					// TODO: implement the other subclasses of CmPossibility.
					throw new NotImplementedException();
			}
		}
예제 #4
0
			public PartOfSpeechCreator(IPartOfSpeechFactory fact)
			{
				m_fact = fact;
			}