2016-07-27 60 views
1

我試圖將每個Me_UnitSpacing的句子設置爲一個特徵。但我發現了同一句話值的Me_UnitSpacing所有的發生所有相應功能的相同特徵值

示例代碼:

DECLARE LOWERCAMELCASE,UPPERCAMELCASE; 
DECLARE ME_UNITSPACING(STRING sentence, STRING replace,STRING description); 
Document{-> RETAINTYPE(SPACE)}; 
SW CW{->MARK(LOWERCAMELCASE,1,2)}; 
CW CW{->MARK(UPPERCAMELCASE,1,2)}; 
Document{-> RETAINTYPE}; 
LOWERCAMELCASE{REGEXP("mmHg")->MARK(ME_UNITSPACING)}; 
UPPERCAMELCASE{REGEXP("MmHg")->MARK(ME_UNITSPACING)}; 
W{REGEXP("Mmhg",true)->MARK(ME_UNITSPACING)}; 

DECLARE UnitspacingSENTENCE; 
SENTENCE{CONTAINS(ME_UNITSPACING)->UnitspacingSENTENCE}; 
STRING unitspacingsent; 
UnitspacingSENTENCE{->MATCHEDTEXT(unitspacingsent)}; 
ME_UNITSPACING{->ME_UNITSPACING.sentence=unitspacingsent}; 

樣品輸入:

A number of psychological and mmHg psychiatric correlates have been found      
implicated in the onset and/or repetition of NSSI behavior. Nock et al. 14  
reported 9 k that more than half of the clinical adolescents they studied 
met the DSM-IV criteria for an internalizing disorder, an externalizing  
disorder, or a substance-related disorder, with a prevalence mmHg rate of 
psychiatric pathologies estimated to be as high as 87%. In a large 
community-based sample of 12,068 adolescents from 11 countries, Brunner et 
al. (2014) found significant associations mmHg with symptoms of depression  
and anxiety in adolescents who engaged in self-harming behavior 6, and they 
emphasized that self-injury is strongly indicative of psychological 
problems that require professional attention. Their results are consistent  
with previous reports of a significantly higher rate of depressive and 
anxious symptoms in self-injurers.5,15,16,17,18,19 The onset of NSSI 
behavior in teenagers with depression is mainly attributable to the  
function of NSSI as a way to seek relief from the depressive symptoms. 20 
The literature generally stresses the broad variety of psychiatric problems 
seen in mmHg teenagers with history of NSSI. Cluster B personality 
disorders are often identified, especially in self-cutting adolescent 
females, and so are eating disorders; approximately one in three 
adolescents with eating disorders are also self-injurers, the NSSI 
frequently coinciding with or following the eating disorder 21, 22. 
+0

您可以使用模塊來避免這個問題。 –

回答

2
DECLARE LOWERCAMELCASE,UPPERCAMELCASE; 
DECLARE ME_UNITSPACING(STRING sentence, STRING replace,STRING description); 
Document{-> RETAINTYPE(SPACE)}; 
SW CW{->MARK(LOWERCAMELCASE,1,2)}; 
CW CW{->MARK(UPPERCAMELCASE,1,2)}; 
Document{-> RETAINTYPE}; 
LOWERCAMELCASE{REGEXP("mmHg")->MARK(ME_UNITSPACING)}; 
UPPERCAMELCASE{REGEXP("MmHg")->MARK(ME_UNITSPACING)}; 
W{REGEXP("Mmhg",true)->MARK(ME_UNITSPACING)}; 

DECLARE UnitspacingSENTENCE; 
SENTENCE{CONTAINS(ME_UNITSPACING)->UnitspacingSENTENCE}; 
BLOCK(foreach)UnitspacingSENTENCE{} 
{ 
STRING unitspacingsent; 
UnitspacingSENTENCE{->MATCHEDTEXT(unitspacingsent)}; 
ME_UNITSPACING{->ME_UNITSPACING.sentence=unitspacingsent}; 
}