@@ -177,7 +177,10 @@ private void LoadLanguage()
177177
178178 var prodRestrictsGroup = new MprFeatureGroup { Name = "exceptionFeatures" , MatchType = MprFeatureGroupMatchType . All } ;
179179 foreach ( ICmPossibility prodRestrict in m_cache . LanguageProject . MorphologicalDataOA . ProdRestrictOA . ReallyReallyAllPossibilities )
180+ {
180181 LoadMprFeature ( prodRestrict , prodRestrictsGroup ) ;
182+
183+ }
181184 if ( prodRestrictsGroup . MprFeatures . Count > 0 )
182185 m_language . MprFeatureGroups . Add ( prodRestrictsGroup ) ;
183186
@@ -1838,19 +1841,29 @@ private CompoundingRule LoadEndoCompoundingRule(IMoEndoCompound compoundRule)
18381841 {
18391842 var headRequiredFS = new FeatureStruct ( ) ;
18401843 var nonheadRequiredFS = new FeatureStruct ( ) ;
1844+ var headProdResticts = new MprFeatureSet ( ) ;
1845+ var nonheadProdResticts = new MprFeatureSet ( ) ;
18411846 if ( compoundRule . HeadLast )
18421847 {
18431848 if ( compoundRule . RightMsaOA . PartOfSpeechRA != null )
18441849 headRequiredFS . AddValue ( m_posFeature , LoadAllPartsOfSpeech ( compoundRule . RightMsaOA . PartOfSpeechRA ) ) ;
18451850 if ( compoundRule . LeftMsaOA . PartOfSpeechRA != null )
18461851 nonheadRequiredFS . AddValue ( m_posFeature , LoadAllPartsOfSpeech ( compoundRule . LeftMsaOA . PartOfSpeechRA ) ) ;
1852+ if ( compoundRule . RightMsaOA . ProdRestrictRC . Count > 0 )
1853+ CreateProdRestricts ( compoundRule . RightMsaOA . ProdRestrictRC , headProdResticts ) ;
1854+ if ( compoundRule . LeftMsaOA . ProdRestrictRC . Count > 0 )
1855+ CreateProdRestricts ( compoundRule . LeftMsaOA . ProdRestrictRC , nonheadProdResticts ) ;
18471856 }
18481857 else
18491858 {
18501859 if ( compoundRule . RightMsaOA . PartOfSpeechRA != null )
18511860 nonheadRequiredFS . AddValue ( m_posFeature , LoadAllPartsOfSpeech ( compoundRule . RightMsaOA . PartOfSpeechRA ) ) ;
18521861 if ( compoundRule . LeftMsaOA . PartOfSpeechRA != null )
18531862 headRequiredFS . AddValue ( m_posFeature , LoadAllPartsOfSpeech ( compoundRule . LeftMsaOA . PartOfSpeechRA ) ) ;
1863+ if ( compoundRule . RightMsaOA . ProdRestrictRC . Count > 0 )
1864+ CreateProdRestricts ( compoundRule . RightMsaOA . ProdRestrictRC , nonheadProdResticts ) ;
1865+ if ( compoundRule . LeftMsaOA . ProdRestrictRC . Count > 0 )
1866+ CreateProdRestricts ( compoundRule . LeftMsaOA . ProdRestrictRC , headProdResticts ) ;
18541867 }
18551868 headRequiredFS . Freeze ( ) ;
18561869 nonheadRequiredFS . Freeze ( ) ;
@@ -1870,6 +1883,8 @@ private CompoundingRule LoadEndoCompoundingRule(IMoEndoCompound compoundRule)
18701883 Name = compoundRule . Name . BestAnalysisAlternative . Text ,
18711884 HeadRequiredSyntacticFeatureStruct = headRequiredFS ,
18721885 NonHeadRequiredSyntacticFeatureStruct = nonheadRequiredFS ,
1886+ HeadProdRestrictionsMprFeatures = headProdResticts ,
1887+ NonHeadProdRestrictionsMprFeatures = nonheadProdResticts ,
18731888 OutSyntacticFeatureStruct = outFS ,
18741889 Properties = { { HCParser . CRuleID , compoundRule . Hvo } }
18751890 } ;
@@ -1894,6 +1909,14 @@ private CompoundingRule LoadEndoCompoundingRule(IMoEndoCompound compoundRule)
18941909 return hcCompoundRule ;
18951910 }
18961911
1912+ private void CreateProdRestricts ( ILcmReferenceCollection < ICmPossibility > ruleProdRestricts , MprFeatureSet prodResticts )
1913+ {
1914+ foreach ( var prodRstrict in ruleProdRestricts )
1915+ {
1916+ prodResticts . Add ( m_mprFeatures [ prodRstrict ] ) ;
1917+ }
1918+ }
1919+
18971920 private IEnumerable < CompoundingRule > LoadExoCompoundingRule ( IMoExoCompound compoundRule )
18981921 {
18991922 var rightRequiredFS = new FeatureStruct ( ) ;
@@ -1908,6 +1931,12 @@ private IEnumerable<CompoundingRule> LoadExoCompoundingRule(IMoExoCompound compo
19081931 if ( compoundRule . ToMsaOA . PartOfSpeechRA != null )
19091932 outFS . AddValue ( m_posFeature , m_posFeature . PossibleSymbols [ "pos" + compoundRule . ToMsaOA . PartOfSpeechRA . Hvo ] ) ;
19101933 outFS . Freeze ( ) ;
1934+ var headProdResticts = new MprFeatureSet ( ) ;
1935+ var nonheadProdResticts = new MprFeatureSet ( ) ;
1936+ if ( compoundRule . RightMsaOA . ProdRestrictRC . Count > 0 )
1937+ CreateProdRestricts ( compoundRule . RightMsaOA . ProdRestrictRC , headProdResticts ) ;
1938+ if ( compoundRule . LeftMsaOA . ProdRestrictRC . Count > 0 )
1939+ CreateProdRestricts ( compoundRule . LeftMsaOA . ProdRestrictRC , nonheadProdResticts ) ;
19111940
19121941 var headPattern = new Pattern < Word , ShapeNode > ( "head" , AnyPlus ( ) ) ;
19131942 headPattern . Freeze ( ) ;
@@ -1919,6 +1948,8 @@ private IEnumerable<CompoundingRule> LoadExoCompoundingRule(IMoExoCompound compo
19191948 Name = compoundRule . Name . BestAnalysisAlternative . Text ,
19201949 HeadRequiredSyntacticFeatureStruct = rightRequiredFS ,
19211950 NonHeadRequiredSyntacticFeatureStruct = leftRequiredFS ,
1951+ HeadProdRestrictionsMprFeatures = headProdResticts ,
1952+ NonHeadProdRestrictionsMprFeatures = nonheadProdResticts ,
19221953 OutSyntacticFeatureStruct = outFS ,
19231954 Properties = { { HCParser . CRuleID , compoundRule . Hvo } }
19241955 } ;
@@ -1944,6 +1975,8 @@ private IEnumerable<CompoundingRule> LoadExoCompoundingRule(IMoExoCompound compo
19441975 Name = compoundRule . Name . BestAnalysisAlternative . Text ,
19451976 HeadRequiredSyntacticFeatureStruct = leftRequiredFS ,
19461977 NonHeadRequiredSyntacticFeatureStruct = rightRequiredFS ,
1978+ HeadProdRestrictionsMprFeatures = nonheadProdResticts ,
1979+ NonHeadProdRestrictionsMprFeatures = headProdResticts ,
19471980 OutSyntacticFeatureStruct = outFS ,
19481981 Properties = { { HCParser . CRuleID , compoundRule . Hvo } }
19491982 } ;
0 commit comments