Lấy ra raw string từ các câu đã được pos tagged

Đầu vào: Câu đã được POS Tagging. Ví dụ

Upon_IN such_JJ reading_NN of_IN any_DT such_JJ certificate_NN or_CC paper_NN ,_, the_DT President_NNP of_IN the_DT Senate_NNP shall_MD call_VB for_IN objections_NNS ,_, if_IN any_DT ._.

Đầu ra: Câu chưa được POS Tagging

Upon such reading of any such certificate or paper , the President of the Senate shall call for objections , if any

Hàm ruby (Sử dụng hàm gsub)

def get_raw_text(str)
return str.gsub(/_(.+?)\s|_(.+?)/, ' ').strip
end

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: