텍스트 전처리에 필요한 패키지 로드

library(pdftools)
library(stringr)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(wordcloud)
## Loading required package: RColorBrewer

트윗 또는 댓글의 전처리

텍스트 전처리

PDF 문서로부터 문자열을 추출하여 처리하기

우리가 오늘 작업할 디지털 문서는 BTS에 대한 설명을 제공하는 위키피디아 페이지이다. 이 페이지로부터 우리는 해당 내용을 담고있는 PDF 문서를 다운로드 받을 수 있다. 다운로드 받은 문서는 “pnp_script.pdf”이고 이것을 우리의 Working Directory로 옮긴다면 다음의 코드를 실행할 준비가 된다.

pnp_text <- pdf_text("pnp_script.pdf")
#strsplit() 함수의 결과값은 벡터가 아닌 리스트이다.
class(pnp_text)
## [1] "character"
pnp_text <- paste(pnp_text, collapse=" ")
pnp_text_line <- str_split(pnp_text, pattern = "\n") #"\n"으로 구별되는 각 줄별로 텍스트를 쪼개기
pnp_text_non <- unlist(str_replace_all(pnp_text, "\n", " "))
pnp_text_sent <- unlist(str_split(pnp_text_non, pattern="\\. ")) #줄별로 나눠진 텍스트를 메타문자가 아닌 마침표("\\.")로 구별된 문장단위로 쪼개기
pnp_text_word <- unlist(strsplit(pnp_text, split=" |\n")) #문장단위로 나눠진 텍스트를 빈칸(" ")으로 구별되는 단어단위로 쪼개기
pnp_text_word <- unlist(pnp_text_word) #리스트로서의 결과값을 벡터로 바꿔주기
pnp_text_word <- tolower(pnp_text_word)

온라인 텍스트 전처리 (예: 트윗, 댓글, 블로그)

  1. 표준화 (lower-case)
  2. 빈칸 (white space)
  3. 구두점 (punctuation)
  4. 숫자 (digit numbers)
  5. 불용어 (stop words)
  6. 영어 이외의 문자 (non-English text)
  7. URL

간단하지만 불완전한 정리…

pnp_text_word[1:50]
##  [1] ""          ""          ""          ""          ""         
##  [6] ""          ""          ""          ""          ""         
## [11] ""          ""          ""          ""          ""         
## [16] ""          ""          ""          ""          ""         
## [21] ""          ""          ""          ""          ""         
## [26] ""          ""          ""          ""          ""         
## [31] ""          ""          ""          ""          ""         
## [36] ""          ""          "pride"     "and"       "prejudice"
## [41] ""          ""          ""          ""          ""         
## [46] ""          ""          ""          ""          ""
pnp_text_word_main <- pnp_text_word[nchar(pnp_text_word)>0]
length(pnp_text_word_main)
## [1] 15754
pnp_text_word_freq <- sort(table(pnp_text_word_main), decreasing = TRUE)
# sort: 결과값을 올림(내림)차순 정렬할 때 사용할 수 있는 함수
# table: 벡터 값들의 출현 횟수를 정리할 대 사용할 수 있는 함수
pnp_text_word_freq[1:50]
## pnp_text_word_main
##     the      to     and       a       i      mr      of      is     you 
##     580     374     328     313     266     261     251     228     209 
##       -  lizzie lizzie:      in     her      at      he     she     mrs 
##     204     193     187     185     157     136     121     121     116 
##    with    have      as     are      my    your bennet:     for      it 
##     116      98      95      93      91      89      88      88      86 
##     not     his    that   darcy  darcy:      be     but      on  bennet 
##      82      80      80      79      79      77      67      66      64 
##    int. collins      do    from    will    jane      so      we    they 
##      61      55      54      54      52      51      50      50      49 
##    been     has    day.      me    what 
##      48      48      47      47      45
tail(pnp_text_word_freq[pnp_text_word_freq==1])
## pnp_text_word_main
## you...l  young.   yours  yours,  yours.       � 
##       1       1       1       1       1       1

위의 전처리 과정을 통해:

  1. 표준화: 소문자로 통일

  2. 빈칸 (white space): 해결!

  3. 구두점 (punctuation): 어떠한 구두점을 지울 것인지 아직 알 수 없음

  4. 숫자 (digit numbers): 어떤 숫자를 지울 것인지 아직 알 수 없음

  5. 불용어 (stop words): 불용어에 대해 좀 더 알아보자

  6. 영어 이외의 문자 (non-English text): 영어 이외의 문자만 선택하여 지울수 있는 방법?

  7. URL: 정규표현식 구성

“stringr’ 패키지

함수 설명 유사한 기본 함수
str_length() 문자의 수 nchar()
str_split() 문자열 분리 strsplit()
str_c() 문자열 연결 paste()
str_detect() 문자열의 패턴 유무 인식하여 결과(T/F)를 반환합니다) none
str_view_all() 매칭된 문자열 모두를 보여줌 none

stringr 패키지에 있는 모든 함수는 "str_"로 시작하고 뒤에는 수행 작업과 관련된 용어가 따라옵니다.

패턴 매칭을 위한 유용한 stringr 함수

대부분의 stringr 함수는 처리하고자 하는 특정 패턴의 텍스트를 찾는데 필요한 정규 표현식과 함께 쓰입니다.

텍스트 사전처리에 유용한 stringr의 함수들을 좀 더 소개해드리자면:

함수 정의
str_trim() 문자열의 선/후 공백을 제거합니다.
str_which() 문자열 벡터에서 일치하는 텍스트 패턴의 모든 위치를 반환합니다.
str_extract() 각 문자열 요소에서 처음으로 일치하는 텍스트 패턴을 추출합니다.
str_extract_all() 각 문자열 요소에서 일치하는 모든 텍스트 패턴을 추출합니다.
str_replace() 각 문자열 요소에서 처음으로 일치하는 텍스트 패턴을 원하는 문자열로 바꿉니다.
str_replace_all() 각 문자열에서 일치한는 모든 텍스트 패턴을 원하는 문자열로 바꿉니다.

그럼 이런 stringr 패키지의 기능을 바탕으로 지난 시간에 텍스트 전처리를 진행한 과정을 살펴봅시다.

텍스트 전처리

library(tidytext)
class(pnp_text_line)
## [1] "list"
pnp_text_line <- unlist(pnp_text_line)

pnp_df <- data_frame(line = 1:length(pnp_text_line),
                     text = pnp_text_line)

pnp_df[1:20,]
## # A tibble: 20 x 2
##     line text                                                             
##    <int> <chr>                                                            
##  1     1 "                                     Pride and Prejudice"       
##  2     2 "                              Screenplay by Deborah Moggach"    
##  3     3 "                               Shooting script 28th June 2004"  
##  4     4 1 EXT. LONGBOURN HOUSE - DAY.                                    
##  5     5 FADE UP ON: A YOUNG WOMAN, as she walks through a field of tall,…
##  6     6 reading a novel entitled 'First Impressions'.                    
##  7     7 This is LIZZIE BENNET, 20, good humoured, attractive, and nobody…
##  8     8 Longbourn, a fairly run down 17th Century house with a small moa…
##  9     9 up onto a wall and crosses the moat by walking a wooden plank du…
## 10    10 learnt in early childhood. She walks passed the back of the hous…
## 11    11 window to the library, we see her mother and father, MR and MRS …
## 12    12 MRS BENNET: My dear Mr Bennet, have you heard that Netherfield P…
## 13    13 We follow Lizzie into the house, but still overhear her parents'…
## 14    14 MRS BENNET: (cont'd) Do you not want to know who has taken it? M…
## 15    15 wish to tell me, I doubt I have any choice in the matter.        
## 16    16 2 INT. LONGBOURN - CONTINUOUS.                                   
## 17    17 As Lizzie walks through the hallway, we hear the sound of piano …
## 18    18 the afternoon. She walks down the entrance hall past the room wh…
## 19    19 bluestocking of the family, is practising, and finds KITTY (16) …
## 20    20 at the door to the library. Lizzie pokes Lydia.
pnp_df <- pnp_df %>% 
  mutate(text = str_trim(text))

unlist(str_extract_all(pnp_text[1], pattern = " "))[1:30]
##  [1] " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "
## [18] " " " " " " " " " " " " " " " " " " " " " " " " " "
pnp_text_token <- str_split(unlist(pnp_text), pattern = " ")
unlist(pnp_text_token)[1:30]
##  [1] "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
## [24] "" "" "" "" "" "" ""
pnp_sent_trim <- unlist(pnp_text_token)[str_length(unlist(pnp_text_token))>0]
pnp_sent_trim[1:30]
##  [1] "Pride"       "and"         "Prejudice\n" "Screenplay"  "by"         
##  [6] "Deborah"     "Moggach\n"   "Shooting"    "script"      "28th"       
## [11] "June"        "2004\n1"     "EXT."        "LONGBOURN"   "HOUSE"      
## [16] "-"           "DAY.\nFADE"  "UP"          "ON:"         "A"          
## [21] "YOUNG"       "WOMAN,"      "as"          "she"         "walks"      
## [26] "through"     "a"           "field"       "of"          "tall,"
  1. 구두점 : 다양한 구두점의 종류, 어떤 구두점을 제거해야 할지를 고민. 일일이 지정하기 귀찮음.

  2. 숫자 : 어떤 숫자를 제거해야 할지를 지정할 수 없습니다. 등장하는 숫자 모두를 일일이 지정하기 불가능.

모든 구두점 또는 모든 숫자를 찾아내서 한꺼번에 지워줄 수 있는 방법?

이 문제를 해결하기 위해, 정규 표현에 대해 배워봅시다.

정규 표현식

지금까지 R에서 텍스트를 다루고 처리하기 위한 몇가지 기본 기능을 학습하였습니다. 하지만 이 과정에서 우리는 문자열을 자유롭게 다룰 수 있어야 한다는 점도 느낌. 그래서 우리는 정규 표현식(regular expressions)에 대해 알아볼 것입니다.

정규 표현식이란 무엇일까요?

정규 표현식이라는 용어는 낯설게 느껴지고 그 예는 복잡하게 보일 수 있습니다. 하지만 정규 표현식은 텍스트를 구성하는 방식에 관한 것입니다. 오늘날 우리는 이메일, 문자 메세지, 뉴스 기사, 블로그, 댓글, 트윗과 같은 다양한 디지털 텍스트를 쉽게 접할 수 있죠. 이러한 데이터들은 모두 디지털 기호로 이뤄져 있기 때문에, 우리가 텍스트를 구성하는 방식을 안다면 많은 양의 데이터를 즉 빅데이터를 다룰 수 있는 힘을 갖게 됩니다. 다시 말해, 정규 표현식을 이용해서 디지털 텍스트를 처리할 수 있는 것이죠.

그럼 정규 표현식은 무엇일까요? regular expression, 즉 정규 표현식은 텍스트의 특정 pattern을 찾아내기 위한 특수 문자열입니다. 결국 정규 표현식은 문자열 집합을 매칭하기 위한 기호 집합이죠. 영어로 regular expression이라는 용어 자체가 다소 길기 때문에, 흔히 regex 라고 짧게 줄여서 지칭합니다. 저도 이 수업에서 정규 표현과 regex를 혼용해서 사용할 것입니다.

하지만, 정규표현식은 프로그래밍 언어는 아니라는 점에 주목할 필요가 있습니다. regex가 프로그래밍 언어처럼 보일지도 모르겠습니다. 왜냐하면 정규 표현은 컴퓨터를 통해 텍스트에서 우리가 원하는 것을 찾아내는데 사용된는 규칙의 집합이기 때문입니다. 그러나 regex는 변수를 지정할 수 없고, 2+2와 같은 계산을 추가할 수 없기 때문에, 프로그래밍 언어라 말할 순 없습니다.

정규표현식에 들어가기 전에…

정규 표현식은 처음에는 이해하기 어려울 수 있습니다. 무의미한 방식으로 결합된 문자, 숫자 및 구두점이 포함된 문자열을 볼 수 있기 때문입니다. 프로그래밍 및 데이터 분석과 마찬가지로, 정규 표현식을 학습하고 정규 표현식 패턴을 정의하는 데에 시간이 걸리므로 많은 연습이 필요합니다. 그러나 연습을 많이하면 할수록 더 복잡한 패턴을 정의할 수 있고 제거할 수도 있습니다. 그리고 정규 표현식은 Python, Perl, Java와 같은 다른 프로그래밍 언어의 대부분에서 지원되기 때문에 사용에 익숙해지면 매우 유용합니다.

정규 표현식(RegEx)은 어디에 사용될까요?

우리는 정규 표현식을 사용하여 텍스트 작업을 할 것입니다. 가령, 아까 예시에서 언급했던, 구두점, 숫자 그리고 원하지 않는 문자 등을 찾아내서 지우거나 원하는 문자로 바꿔주는 작업을 regex를 이용해서 할 것입니다. 예를 들어, 우리가 전처리하고자 하는 영화 스크립트 텍스트에서 “1 EXT. LONGBOURN HOUSE - DAY.” 와 같이 각 신(scene)을 구별해주는 문구를 찾아낼 수 있다면, 텍스트를 신(scene) 별로 구분해서 분석할 수 있게 됩니다. 또한, 텍스트에 등장하는 구두점과 숫자 표현들, 영어 알파벳 이외의 문자 그리고 웹페이지 주소와 같은 URL을 일일이 지정해서 지워내는 번거로운 작업을 피할 수 있기 때문에 효율적인 텍스트 분석을 가능하게 합니다.

사실, 처리해줘 야 할 텍스트 패턴은 매우 다양할 수 있기 때문에 일일이 모든 경우를 포함시킬 수는 없습니다. 가령, 연도를 가리키는 숫자만 해도 “2018”, “2016”, “2017”에 국한된 것이 아니라 더 많은 다양한 경우가 올 수 있기 때문에, 이러한 규칙을 가진 숫자 표현 모두를 매칭해서 처리해주는 정규 표현이 필요합니다. 이런 방식으로 텍스트에 등장하는 그리고 우리가 지워줘야 하는 모든 문자열, 숫자 또는 구두점을 찾아서 처리할 수 있죠.

정규표현식의 기본

다시 한번 강조하자면, 정규 표현식은 특정 텍스트 문자열을 일괄적으로 찾아낼 수 있는 패턴을 구성하는 것이라 할 수 있습니다. 따라서 regex를 사용할 경우 우리가 처리하고자 하는 텍스트 패턴을 모두 찾아낼 수 있습니다. 그리고 stringr 패키지에서 regex pattern을 잘 구성해서 이용하는 것은 그래서 매우 중요합니다.

그러면 어떻게 regex를 구성해야 할까요. 위에서 언급했듯, 패턴 매칭의 가장 간단한 방법은 특정 문자열 그대로를 찾도록 만드는 것입니다. 예를 들어, 지난 시간에 우리는 텍스트 문서에서 “the”라는 문자열을 매칭하고자 하는 문자패턴 그대로의 regex를 사용해서 그 위치를 검색하는 것이죠.

하지만 대부분의 경우 보다 복잡한 구조의 정규표현식 패턴을 만들어야 할 필요가 생깁니다. 예를 들어서 위키피디아 페이지에서 모든 숫자, 또는 모든 구두점, 또는 해시 태그나 url 또는 영어가 아닌 글자들을 모두 매칭해서 처리하려면 어떻게 해야 할까요? 이러한 필요를 충족시키는 regex 구성 방법에 대해서 설명드리도록 하겠습니다.

리터럴 문자의 일치

우선, 가장 단순한 일치로 시작해봅시다. : 문자 그대로의 패턴 리터럴 문자 일치는 문자 “A”와 같은 주어진 문자가 문자 “A”와 일치한다는 것입니다. 이 것은 그 자체로 일치하기 때문에 literal이라고 불리웁니다. 이 유형의 일치는 가장 기본적인 유형의 정규표현식 연산입니다. 일반 텍스트와 따옴표만 일치시킵니다.

다음은 정규표현식에 대한 기본적인 이해의 예입니다.

우리가 정규표현식으로 매칭할 첫번째 문자열은 단어 "the"입니다. 이 문자열은 문자 “t”, 문자 “h”, 문자 “e로 구성됩니다. 그러나 우리가 regex 패턴을”the“로 구성한다면 단어”the“뿐만 아니라 단어”they“와”soothe" 또한 매칭하는 결과를 얻게 될 것입니다. 따라서 따라서 정규 표현식 패턴은 시작과 끝에 공백이 있어야 하겠죠: " the "

다시 한번 강조하자면, 정규표현식에서 공백은 문자로 인식됩니다.

자 이제, 문자열 객체 pnp_text로부터 줄 단위로 문자열을 구분하여 벡터화 한 pnp_text_line에 정규표현식을 적용해 봅시다.

우리가 구성한 정규표현이 문자열 객체에서 찾아낸 즉, 매칭된 결과를 확인하기 위해 우리는 str_extract_all() 함수를 사용하겠습니다.

pnp_text
## [1] "                                     Pride and Prejudice\n                              Screenplay by Deborah Moggach\n                               Shooting script 28th June 2004\n1 EXT. LONGBOURN HOUSE - DAY.\nFADE UP ON: A YOUNG WOMAN, as she walks through a field of tall, meadow grass. She is\nreading a novel entitled 'First Impressions'.\nThis is LIZZIE BENNET, 20, good humoured, attractive, and nobody's fool. She approaches\nLongbourn, a fairly run down 17th Century house with a small moat around it. Lizzie jumps\nup onto a wall and crosses the moat by walking a wooden plank duck board, a reckless trick\nlearnt in early childhood. She walks passed the back of the house where, through an open\nwindow to the library, we see her mother and father, MR and MRS BENNET.\nMRS BENNET: My dear Mr Bennet, have you heard that Netherfield Park is let at last?\nWe follow Lizzie into the house, but still overhear her parents' conversation.\nMRS BENNET: (cont'd) Do you not want to know who has taken it? MR BENNET: As you\nwish to tell me, I doubt I have any choice in the matter.\n2 INT. LONGBOURN - CONTINUOUS.\nAs Lizzie walks through the hallway, we hear the sound of piano scales plodding through\nthe afternoon. She walks down the entrance hall past the room where MARY (18) the\nbluestocking of the family, is practising, and finds KITTY (16) and LYDIA (15) are listening\nat the door to the library. Lizzie pokes Lydia.\nLIZZIE: Liddy! Kitty - what have I told you about listening at - LYDIA: Never mind that,\nthere's a Mr Bingley arrived from the North\nKITTY: - with more than one chaise\nLYDIA: - and five thousand a year!\nLIZZIE: Really?\nLYDIA: And he's single!\nJANE, the eldest and very beautiful if rather naive sister, materializes at Lizzie's elbow.\nJANE: Who's single?\nLIZZIE: A Mr Bingley, apparently.\nKITTY: Shhhh!\n She clamps her ear to the door.\nLIZZIE: Oh, really Kitty.\nLydia leans in, whilst Jane and Lizzie strain to hear without appearing t_.\n3 INT. LIBRARY - LONGBOURN - CONTINUOUS.\nMr Bennet is trying to ignore Mrs Bennet.\nMRS BENNET: What a fine thing for our girls!\nMR BENNET: How can it affect them?\nMRS BENNET: My dear Mr Bennet, how can you be so tiresome! You know that he must\nmarry one of them.\nMR BENNET: Oh, so that is his design in settling here?\nMr Bennet takes a plant he's been looking at from his table and walks out of the library into\nthe corridor, where the girls are gathered, Mrs Bennet following.\nMR BENNET (cont'd) Good heavens. People.\n4 INT. CORRIDOR - LONGBOURN - THE SAME.\nHe walks through the girls to the drawing room pursued by Mrs Bennet.\nMRS BENNET: - So you must go and visit him at once.\n5 INT. DRAWING ROOM - LONGBOURN - THE SAME.\nMr Bennet walks to a table and places the plant in the light. Mary is still practising the\npiano. The girls flock behind him.\nLYDIA: Are you listening? You never listen.\nKITTY: You must, Papa!\nMRS BENNET: At once!\nMR BENNET: There is no need, for I already have.\nThe piano stops. A frozen silence. They all stare.\nMRS BENNET: You have?\nJANE: When?\nMRS BENNET: How can you tease me, Mr Bennet? Have you no compassion for my poor\nnerves?\nMR BENNET: You mistake me, my dear. I have a high respect for them; they have been my\nconstant companions these twenty years.\n MRS BENNET Is he amiable?\nMARY: Who?\nKITTY Is he handsome?\nMARY: Who?\nLYDIA: He's sure to be handsome.\nLIZZIE: ( ironically) With five thousand a year, would not matter if he had warts and a leer.\nMR BENNET: I will give my hearty consent to his marrying whichever of the girls he\nchooses. Warts and all.\nMARY: Who's got warts?\nLYDIA: So will he come to the ball tomorrow?\nMR BENNET: I believe so.\nLydia and Kitty shriek with excitement and jump up and down.\nKITTY: (to Jane) I have to have your spotted muslin, Jane!\nLYDIA: No, I need it! It makes Kitty look like a pudding.\nKITTY: - Oh please Jane, I'll lend you my green slippers.\nThey both look' onto Jane and pull at her arms. Mr Bennet winks at Lizzie.\n6 EXT. LONGBOURN HOUSE - DAY.\nA wide shot of the house as we continue to hear the girls argue over what they will wear.\n7 INT. ASSEMBLY ROOMS - MERYTON VILLAGE - NIGHT.\nThe local subscription dance is in full swing, (Dance 1) . It's a rough-and-ready, though\nenthusiastic affair: yeoman farmers, small-time squires with their ruddy-cheeked\ndaughters.\nLydia and Kitty are dancing.\nLYDIA: I can't breathe. How am I going to dance all night if I can't breathe?\nKITTY: My toes hurt already.\nLizzie and Jane are a little apart from their family. Jane looks breathtaking.\nLIZZIE: Well, if every man in this room does not end the evening in love with you then I\nam no judge of beauty.\nJANE: Or men.\nLIZZIE: Oh, they are far too easy to judge.\nJANE: They are not all bad.\nLIZZIE: Humourless poppycocks, in my limited experience.\nJANE: One of these days, Lizzie, someone will catch your eye and then you'll have to watch\nyour tongue.\nShe stops speaking and stares. A dazzling group enters the room: George Bingley (25) a\ngood hearted soul but prone to bumbling embarrassment when his enthusiasms get the\nbetter of him, his sister Caroline (23) a victim of every latest fashion, counting herself\nsuperior to most company she encounters, and finally, Mr Fitzwilliam Darcy (27) dashing,\nbrooding with an introversion which could be misconstrued as hauteur. They are dressed in\nthe highest modes.\n The music and dancing stops as the local people turn and stare. The newcomers - creatures\nfrom another world - make quite a stir. Darcy surveys the hall. He catches lizzie's eye. She\nstares, with a kind of surprised shock. Caroline Bingley turns to Darcy.\nCAROLINE: Oh dear, we are a long way from Grosvenor Square, are we not, Mr Darcy?\nHe does indeed look superior to the assembled company.\nSIR WILLIAM LUCAS (53) a hale but unsophisticated member of the self-made gentry,\nhurries to greet the new arrivals. He leads them down the center of the dance floor towards\nthe best seats in the room, stopping occasionally to introduce them to various parties.\nLizzie's great friend Charlotte Lucas, Sir william's daughter - an intelligent, sensible woman\nin her late twenties, comes to Lizzie's side.\nLIZZIE: So which of the painted peacocks is our Mr Bingley?\nCHARLOTTE: He is on the right, and on the left is his sister.\nLIZZIE: And the person with the quizzical brow?\nCHARLOTTE: That is his good friend, 'Mr Darcy.\nLIZZIE: He looks miserabIe, poor soul.\nCHARLOTTE: MiserabIe he may be, but poor he most certainly is not.\nLIZZIE: TeIl me.\nCHARLOTTE: Ten thousand a year and he owns half of Derbyshire.\nLIZZIE The miserable half?\nThey share a complicit giggle.\nSir William Lucas arrives with Darcy and the Bingley's to introduce his daughter Charlotte\nand the Bennet family. Behind them the music and dancing re-start where they left off.\nSIR WILLIAM: (to Mr Bingley) My eldest daughter you know, Mrs Bennet, Miss Jane Bennet,\nElizabeth and Miss Mary Bennet.\nMRS BENNET: It is a pleasure. I have two others but they are already dancing.\nMr Bingley is transfixed by Jane and gazes openly at her.\nMR BINGLEY: Delighted to make your acquaintance.\nSIR WILLIAM: And may I introduce Mr Darcy. (Significant look) - of Pemberley, in\nDerbyshire!\nA stiff bow from Darcy, Lizzie smiles, Darcy does not.\n8 INT. ASSEMBERLY ROOMS - ME RYTON VILLAGE - NIGHT.\nMoments later. Lizzie is standing in a small group with Jane, Bingley, Miss Bingley and\nDarcy.\nJANE: How do you like it here in Hertfordshire, Mr Bingley?\nMR BINGLEY: (smiling at Jane shyly) Very much.\nLIZZIE: The library at Netherfield, I've heard, is one of the finest in the country.\nMR BINGLEY: Yes, it fills me with guilt.\n He looks at Jane and a little blush starts around his collar.\nBINGLEY: Not a good reader, you see. I prefer being out of doors. I mean, I can read, of\ncourse and, and I'm not suggesting you can't read outdoors - of course JANE: I wish I read\nmore, but there always seems so many other things to do.\nBINGLEY: That's exactly what I meant.\nHe beams at Jane, gratefully. The first dance ends. Lydia and Kitty rush past in a state of\nhigh excitement.\nLYDIA: Mama! You will never ever ever ever believe what I'm about to tell you! MR\nBENNET: You've decided to take the veil?\nLydia ignores him.\nMRS BENNET: Tell me quickly, my love\nLYDIA: ( shrieking) The regiment are coming!\nMrs Bennet shrieks too. Mr Bennet winces.\nKITTY: They're to be stationed the whole winter! Stationed in the village, just right there!\nNow all three Bennet females shriek and Lydia actually jumps up and down.\nLYDIA: Officers! Officers as far as the eye can see!\nKITTY: How will we meet them?\nLYDIA: It's easy. You just walk up and down in front of them and drop something.\nLydia pantomimes the actions for Kitty.\nLYDIA (cont' d) They pick it up. You say 'Oh thank you sir' and blush prettily and then\nyou're introduced!\nCouples begin to form for the next dance. Mr Bingley turns to Jane.\nMR BINGLEY: May I have the honour?\nThey leave to dance (Dance 2). Lizzie addresses Darcy as much to distract him from her\nfamily as for any other reason.\nLIZZIE: Do you dance Mr Darcy?\nDARCY: Not if I can help it.\nLizzie, Darcy and Miss Bingley stand in uncompanionable silence.\nOn the dance floor Mr Bingley is dancing with Jane. Ris ears are bright pink. Mrs Bennet,\nwith a group of other mothers, watches the young couple with rather too obvious a\nsatisfaction.\nMRS BENNET: That dress becomes her does it not. Though of course my Jane needs little\nhelp from couturiers.\n Lizzie wanders through the throng. She looks at Bingley and Jane dancing - Jane is calm\nand demure, Bingley clearly smitten\n9 INT. ASSEMBERLY ROOMS - MERYTON VILLAGE - NIGRT\nLater. Darcy is joined by an exhilarated Bingley.\nMR BINGLEY: Upon my word I've never seen so many pretty girls in my life.\nDARCY: You are dancing with the only handsome girl in the room.\nBINGLEY: Oh, she is the most beautiful creature I ever beheld, but her sister Lizzie is very\nagreeable.\nThey have stopped at the edge of the dance floor but have not seen Lizzie and Charlotter\nwho are hiding behind a pillar. Lizzie starts to smile.\nDARCY: Perfectly tolerable, I dare say, but not handsome enough to tempt me.\nLizzie stops smiling.\nDARCY: (cont' d) You had better return to your partner and enjoy her smiles, for you are\nwasting your time with me.\nBingley goes off.\nCUT TO: Lizzie and Charlotte.\nCHARLOTTE: Count your blessings, Lizzie. If he liked you, you'd have to talk to him.\nLIZZIE: Precisely. As it is, I would not dance with him for all of Derbyshire, let alone the\nmiserable half.\nCharlotte smiles at her friend, but sees nonetheless that she is stung.\n10 INT. ASSEMBLY ROOMS - MERYTON VILLAGE - NIGHT.\nLater, (Dance 3). Bingley politely dancing with Charlotte. As he does so, he catches sight of\nJane dancing with somebody else. A look of pure longing, but he cannot dance every dance\nwit4 her. Lizzie too is dancing and clocks this.\nLydia and Kitty are exuberantly dancing too, laughing and chatting. Darcy stands watching,\na look of infinitely superior boredom on his fine features. .\n11 INT. ASSEMBLY ROOMS - MERYTON VILLAGE - NIGHT\nBingley is standing with Jane, Lizzie, Mrs Bennet and Da_cy. (Dance 4) .\nBINGLEY: (to Lizzie) Your friend Miss Lucas is a most amusing young woman.\nLIZZIE: Yes! I adore her.\nMRS BENNET: It is a pity she is not more handsome.\nLIZZIE: Mama!\nMRS BENNET: But Lizzie will never admit she is plain. (to Bingley) Of course it is my Jane\nWho is considered the beauty of the county.\nJANE: Oh! Mama, please!\n MRS BENNET: When she was only fifteen there was a gentleman so much in love with her\nthat I was sure he would make her an offer. However, he did write her some very pretty\nverses.\nLIZZIE: (impatiently) And that put paid to it. I wonder who first discovered the power of\npoetry in driving away love?\nDARCY: I thought that poetry was the food of love.\nLIZZIE: Of a fine, stout love it may. But if it is only a vague inclination, I am convinced that\none poor sonnet will kill it stone dead.\nDarcy looks at Lizzie with a glimmering of interest.\nDARCY: So what do you recommend, to encourage affection?\nLizzie turns and looks at Darcy square on.\nLIZZIE: Dancing. Even if ones partner is barely tolerable.\nShe gives him a dazzling smile. Darcy looks startled. He has no idea she heard him. Now it\nis his turn to blush.\nEnd on a wide shot of the assembly rooms and the dance continuing.\n12 INT. LIZZIE & JANE'S BEDROOM - LONGBOURN - NIGHT.\nLizzie and Jane are both in the same bed under the covers. They are too excited to sleep.\nJane puts on an extra pair of socks to keep herself warm.\nJANE: Mr Bingley is just what a young man ought to be: Sensible, good humoured LIZZIE:\n(completing the list) Handsome, conveniently rich\nJANE: You know perfectly weIl I do not believe marriage should be driven by thoughts of\nmoney.\nLIZZIE: I agree entirely, only the deepest love will persuade me into matrimony, which is\nwhy I will end up an old maid.\nJANE: Do you really believe he liked me, Lizzie?\nLIZZIE: Jane, he danced with you most of the night and stared at you for the rest of it. But\nI give you leave to like him. You've liked many a stupider person.\nJANE: Lizzie!\nLIZZIE: You're a great deal too apt to like people in general, you know. All the world is\ngood and agreeable in your eyes.\nJANE: Not his friend. I still cannot believe what he said about you.\nLIZZIE: Mr Darcy? I could more easily forgive his vanity had he not wounded mine. But no\nmatter. I doubt we shall ever speak again.\nWe move away from the bed and out through the window to take in the starry night sky.\n13 INT. DINING ROOM - LONGBOURN - DAY.\nMrs Bennet presides over breakfast with an endless description of the ball. Mary is doing\nsome needle work, whilst Lydia, Kitty and Jane blearily eat.\nMRS BENNET: ...and then he danced the third with Miss Lucas. Poor thing, it is a shame she\nis not more handsome. There's a spinster in the making and no mistake. The fourth with a\nMiss King of little standing. And the fifth again with Jane.\n MR BENNET: If he'd had any compassion for me he would have sprained his ankle in the\nfirst set.\nMRS BENNET: Oh, Mr Bennet! The way you carry on, anybody would think the girls looked\nforward to a grand inheritance.\nLizzie rolls her eyes at Mr Bennet, they've heard this speech many times before.\nMR BENNET: Kitty, be so kind as to pass the butter.\nMRS BENNET: As you well know, Mr Bennet, when/ you die, which may in fact be very\nsoon\nMR BENNET: As soon as I can manage it.\nMRS BENNET: - our girls will be left without a roof over their head nor a penny to their\nname. LIZZIE: Oh Mother, please! It's ten in the morning.\nBetsy, the maid, enters the room and interrupts Mrs Bennet's babbling.\nBETSY: A letter addressed to Miss Bennet, Ma'am. From Netherfield Hall.\nMRS BENNET: Praise the Lord! We are saved.\nMrs Hill gives the letter to Jane. [No, it's Betsy that hands the letter]\nMRS BENNET (cont'd) Make haste, Jane, make haste. 0 happy day!\nMrs Bennet takes Jane's toast from her hand and whips her napkin off.\nJANE: It is from Caroline.\nMrs Bennet is stopped in her tracks.\nJANE: (cont'd) She has invited me to dine with her. (pause) Her brother will be dining out.\nMRS BENNET Dining out?\nJANE: Can I take the carriage?\nMRS BENNET: Out where? Let me see that.\nShe tweaks the letter from Jane's grasp.\nJANE: It is too far too walk.\nMRS BENNET: Unaccountable of him. Dining out, indeed.\nLIZZIE: Mama! The carriage? For Jane? MRS BENNET Certainly not. She'll go on horseback.\nLIZZIE/JANE Horseback?\n14 EXT. COUNTRYSIDE - DAY.\nJane rides through the countryside. A distant rumble of thunder. She looks up...\n15 SCENE DELETED\n16 SCENE DELETED\n17 EXT. GARDEN - DAY\n A louder rumble of thunder. Betsy hastily pulls clothes from a line, it's bucketing down\nheavily now. Lizzie runs through the garden. She pulls a towel from the washing line as she\npasses.\n18 EXT/INT. HALL/DINING ROOM. LONGBOURN - DAY.\nMr and Mrs Bennet look out at the pouring rain. Lizzie rushes in with the towel and begins\ndrying her hair with it. Through in the kitchen we can see Mr and Mrs Hill\nMRS BENNET: Excellent. Now she will have to stay the night. Exactly as I predicted.\nMR BENNET: Good grief, woman. Your matchmaking skills are becoming positively occult.\nLIZZIE: Though I don't think, Mama, you can reasonably take credit for making it rain.\nLet's hope she doesn't catch her death.\n19 INT. NETHERFIELD � DAY\nA footman opens the great doors to find Jane standing there soaked. She sneezes.\n20 INT. KITCHEN ROOM - LONGBOURN - DAY.\nLizzie reads a letter. Kitty and Lydia are also present.\nLIZZIE: \"And my kind friends will not hear of me returning home until I am better - but do\nnot be alarmed excepting a sore throat, a fever, and a headache there is nothing wrong\nwith me.\" I hope you're satisfied, Mother.\nMR BENNET: Well, my dear, if your daughter does die it will be a comfort to know it was all\nin pursuit of Mr Bingley.\nMRS BENNET: People do not die of colds.\nLIZZIE: Though she might well perish with the shame of having such a mother.\nMr Bennet laughs, but Lizzie is genuinely angry.\nLIZZIE: (cont'd) I am going to Netherfield at once.\nShe stomps out.\n21 EXT. COUNTRYSIDE/NETHERFIELD - DAY.\nLizzie strides _cross vast muddy fields, slipping as she goes. Netherfield is in view on the\nhorizon. She s_ops to take it in, then carries on down an even more muddy track.\n22 INT. NETHERFIELD - BREAKFAST ROOM - DAY.\nIn the large grand dining room Caroline and Darcy are eating breakfast. It's very formal, in\nfact frigid, compared to the volatile Bennet household. Darcy is reading the newspaper,\nCaroline is reading a letter.\nCAROLINE: (puts down the letter) Apparently, -Lady Bathurst is redecorating her ballroom\nin the French style. A little unpatriotic, don't you think?\nMr Darcy is about to answer when the door opens. A footman appears, his face rigid with\ndisapproval.\n FOOTMAN: Miss Lizzie Bennet.\nLizzie comes in, her face flushed, her skirt covered in mud. She looks ravishing. Darcy\nstares at her, then guickly rises to his feet. Caroline Bingley, astonished, looks her up and\ndown.\nCAROLINE: Good Lord, Miss Bennet. Have you walked here?\nLIZZIE: I have. I'm so sorry. How is my sister?\nDARCY: (more kindly) She�s upstairs. (to footman) Show Miss Bennet the way, Alfred.\nLizzie leaves. A beat.\nCAROLINE: Goodness, did you see her petticoat? Six inches deep in mud!\nNo response.\nCAROLINE (cont'd) And her hair, so blowsy and untidy!\nDARCY: I think her concern for her sister does her credit.\nA little pause, Caroline recovers.\nCAROLINE: Oh yes, it's shocking to have a bad cold. I dislike excessively being ill myself.\n[scene 23 has been cut]\n23 INT. NETHERFIELD STAIRS - DAY.\nLizzie races up the stairs to meet Bingley half way. His face lights up when he sees her.\nBINGLEY: Miss Lizzie! Oh I'm so glad to see you\nLIZZIE: How is she?\nBINGLEY: She has a violent cold, but we shall get the better of it. I will have a bed made\nup for you. You must be our guest here until Jane recovers.\n24 INT. NETHERFIELD - JANE'S BEDROOM - DAY.\nLizzie goes into the bedroom where Jane lies in bed, feverish and ill. The blinds are drawn.\nLIZZIE: Jane!\nJane's face lights up. Lizzie kisses her.\nJANE: Lizzie! Oh, your face is so cold [line has been cut]. They're being so kind to me, I\nfeel such a terrible imposition.\nLIZZIE: Don't worry. I don't know who is more pleased at your being here, Mama or Mr\nBingley.\nBingley enters.\nLIZZIE (cont'd) Thank you, for tending to my sister so diligently, it seems she is in better\ncomfort here than she would be at home.\nBINGLEY: It is a pleasure - I mean - not a pleasure that she's ill, of course not, but a\npleasure that she's here - being ill.\n [Scene 25 has been cut]\n25 INT. STAIRCASE - NETHERFIELD - DAY.\nCaroline berates her brother.\nCAROLINE: Stay!? She is a perfectly sweet girl but save being an excellent walker, there is\nvery little to recommend her as a house-guest.\nBINGLEY: I thought she showed remarkable spirit coming all this way.\nCAROLINE: The eldest Miss Bennet, as you know, I hold in excessive regard but as for the\nrest of them\nShe walks down two steps and then turns back.\nCAROLINE: (cont'd) You do realise their uncle is in trade? In Cheapside?\nBINGLEY: (irritably) If they had uncles enough to fill all Cheapside it would not make them\none jot less agreeable, Caroline.\n26 EXT. YARD - LONGBOURN - DAY.\nMr Bennet is admiring a huge boar which has been delivered to cover his sows. Mr Hill, the\nmanservant stands with him. Mrs Bennet bustles up looking smug.\nMRS BENNET: It's all going according to plan. He's head-over-heels already, now all he\nneeds is a little encouragement. [no, Mrs. Bennet says: he's half in love with her\nalready]\nMR BENNET: Who's that, my blossom?\nMRS BENNET: Oh don't torment me, Mr Bennet. I mean Mr Bingley, as you well know, and\nhe doesn't mind a bit that she hasn't a penny for he has enough for the two of them.\nKitty and Lydia rush past as the distant sounds of drums and trumpet mingle with the\nsnipping of Giles's shears.\nMRS BENNET (cont'd) Wait for me!\nMr Bennet gazes at their departing figures, sucking his teeth with relief. He turns back to\nthe boar.\n27 EXT. MERYTON VILLAGE - DAY. _ Mrs Bennet and her two daughters rush down the\nstreet into the village. Dogs bark, children run alongside as a regiment of soldiers march\nthrough the street. Geese scatter, shopkeepers stand in their doorways. The two Bennet\ngirls simper at the hands of the young soldiers. Mrs Bennet, flushed and excited, runs\npanting behind them. Lydia deliberately drops her handkerchief. One of the soldiers stands\non it. She is appalled.\n28 INT. DRAWING ROOM - NETHERFIELD - EVENING.\nLizzie is reading a book. Darcy is writing a letter. Bingley is sat nervously. Caroline,\nobviously bored, wanders the room looking for distraction. She looks over Darcy's shoulder.\nCAROLINE: You write uncommonly fast, Mr Darcy.\nDARCY: (without looking up) You are mistaken. I write rather slowly.\n Caroline lingers, annoyingly.\nCAROLINE: How many letters you must have occasion to write, Mr Darcy. Letters of\nbusiness too. How odious I should think them!\nDARCY: It is fortunate, then, that they fall to my lot instead of yours.\nCAROLINE: Please tell your sister that I long to see her.\nDARCY: I have already told her once, by your desire.\nLizzie looks across from her book.\nCAROLINE: I do dote on her, I was quite in raptures at her beautiful little design for a table.\nDARCY: Perhaps you will give me leave to defer your raptures till I write again. At present I\nhave not enough room to do them justice.\nMr Bingley now pacing anxiously around the room.\nBINGLEY: It's amazing, how young ladies have the patience to be so accomplished.\nCAROLINE: What do you mean, Charles?\nBINGLEY: They all paint tables, and embroider cushions and play the piano. I never heard\nof a young lady, but people say she is accomplished.\nDARCY: The word is indeed applied too liberally. I cannot boast of knowing more than half\na dozen women, in all my acquaintance, that are truly accomplished.\nCAROLINE: Nor I, to be sure!\nLIZZIE: Goodness! You must comprehend a great deal in the idea.\nDARCY: I do.\nCAROLINE: Absolutely. She must have a thorough knowledge of music, singing, drawing,\ndancing and the modern languages, to deserve the word. And something in her air and\nmanner of walking.\nDARCY: And of course she must improve her mind by extensive reading.\nLizzie closes her book.\nLIZZIE: I am no longer surprised at your knowing only six accomplished w6men. I rather\nwonder now at your knowing any.\nDARCY: Are you so severe on your own sex?\nLIZZIE: I never saw such a woman. She would certainly be a fearsome thing to behold.\nPause. Darcy goes back to his letter. Caroline picks up a book. Pauses. Puts it down. She\nwalks over to Lizzie.\nCAROLINE: Miss Bennet, let us take a turn about the room.\nLizzie, surprised, gets up. Caroline links her arm and they start walking up and down.\nCAROLINE: (cont'd) It's refreshing, is it not, after sitting so long in one attitude?\nLIZZIE: And it's a small kind of accomplishment, I suppose.\nDarcy meets Lizzie's eye, briefly. He doesn't know how to cope with the idea that she's\nlaughing at him. Caroline turns to Darcy.\nCAROLINE: Mr Darcy, will you join us?\nDARCY: (shakes his head) You can only have two motives, Caroline, and I would interfere\nwith either.\nCAROLINE: (to Lizzie, archly) What can he mean?\nLIZZIE: Our surest way of disappointing him will be to ask nothing about it. CAROLINE: (to\n Darcy) Please tell us!\nDARCY: Either you are in each other's confidence and have secret affairs to discuss, or you\nare conscious that your figures appear to the greatest advantage by walking. If the first, I\nshould get in your way. If the second, I can admire you much better from here.\nCAROLINE: Oh, shocking! How shall we punish him for such a speech?\nLIZZIE: We could always laugh at him.\nCAROLINE: Oh no, Mr Darcy is not to be teased! LIZZIE: Are you too proud, Mr Darcy? And\nwould you consider pride a fault or a virtue?\nDARCY: That I couldn't say.\nLIZZIE: Because we're doing our best to find a fault in you.\nDARCY: Maybe, it's that I find it hard to forgive the follies and vices of others, or their\noffences against myself. My good opinion, once lost, is lost forever.\nLIZZIE: Oh dear, I cannot tease you about that. What a shame, for I dearly love to laugh.\nCAROLINE: (small smile) A family trait I think.\nLizzie smiles, sweetly. Caroline glances at Darcy, expecting to have triumphed, but he's\njust looking put-out.\n[Scenes 29 - 32 have been cut]\n29 INT. JANE'S BEDROOM - NETHERFIELD - MORNING. Jane is asleep in bed. Lizzie is\nawake in a small cot bed next to Jane. She gets up.\n30 EXT. COUNTRYSIDE - MORNING. Darcy gallops through the countrysidel still looking\nputout.\n31 EXT. BACK LAWN TO PARK LAND - NETHERFIELD - MORNING.\nLizzie stands on the edge of the formal garden looking out onto to the rustic parkland.\nSuddenly Darcy emerges over the crest of a hilI and gallops towards the house. He pulls\nthe horse to a halt as he sees Lizzie. With his wet hair flattened against his head and his\nface soaked in sweat he looks for a second like a mysterious and beautiful boy. They lock\neyes for a brief moment before Lizzie turns in a shiver and walks away.\n32 INT. JANE�S BEDROOM - NETHERFIELD - MORNING.\nLizzie enters the room and goes to Jane's bed. Jane is waking up.\nLIZZIE: Jane, do you think you might feel weIl enough to leave today?\n33 INT. DRAWING ROOM - NETHERFIELD - DAY.\nThe doors open. The Footman as before:\nFOOTMAN: A Mrs Bennet, a Miss Bennet, a Miss Bennet and a Miss Bennet, sir.\nCAROLINE: Are we to receive every Bennet in the country?\nMrs Bennet, Lydia, Mary and Kitty are introduced to Caroline, Bingley and Darcy. Lizzie\nholds her breath as her mother launches into familiar form.\nMRS BENNET: What an excellent room you have sir. Such expensive furnishings. I hope\nyou intend to stay here, Mr Bingley.\n BINGLEY: Absolutely I find the country very diverting. Don't you agree, Darcy?\nDARCY: I find it perfectly adequate even if society is a little less varied than in town.\nMRS BENNET: Less varied? Not at all! We dine with four and twenty families of all shapes\nand sizes. Sir William Lucas for instance is a very agreeable man. A good deal less self-\nimportant than some people of half his rank.\nLizzie cringes.\nLYDIA: Mr Bingley, is it true that you have promised to hold a ball here at Netherfield?\nBINGLEY: A ball?\nLYDIA: It would be an excellent way to meet new friends. You could invite the militia. They\nare excellent company.\nKITTY: Oh do hold a ball.\nLIZZIE: (trying to stop Bingley being bamboozled) Kitty�\nBINGLEY: When your sister has recovered you shall name the day.\nMARY: I think a Ball is a perfectly irrational way to gain new acquaintance. It would be\nbetter if conversation instead of dancing were the order of the day.\nCAROLINE: Indeed much more rational but rather less like a ball.\nLIZZIE: Thank you, Mary.\nBINGLEY: (to Mrs Bennet) Please let me show you to Jane, you will find her quite\nrecovered. [this line has been deleted]\n34 EXT. DRIVE - NETHERFIELD - DAY.\nThe Bennet's carriage awaits. The Bingleys are gathered to see the Bennets off. Jane is\nradiant - in the peak of the health that only love brings.\nJANE: (to the Bingleys) I don't know how to thank you.\nBingley beams bashfully.\nBINGLEY: You're welcome anytime you feel the least bit poorly. I mean - you're welcome at\nany time, but not any less welcome if you know you're -\nHe hands her into the carriage, still babbling. Jane remains demure.\nLIZZIE: (to Caroline) Thank you, for such stimulating company. It has been most\ninstructive.\nCAROLINE: Not at all. The pleasure is all mine.\nLizzie looks at Darcy, who bows wordlessly.\nLIZZIE: Mr Darcy.\nDARCY Miss Bennet.\nMaintaining his glacial exterior, Darcy moves forward and, before Bingley can do so, hands\nLizzie into her carriage.\nShe gives him a surprised glance as their hands meet and then, unaccountably, blushes.\nBingley starts to wave violently as the carriage draws off. Darcy turns without a second\nglance. Caroline watches him narrowly.\nBINGLEY: Goodbye. Goodbye.\n [scenes 35 - 37 have been cut]\n35 INT. CARRIAGE - LEAVING NETHERFIELD - THE SAME.\nThe family are all squeezed in rather too tightly.\nMRS BENNET: What a high and mighty man that Mr Darcy is, quite eaten up with pride.\nLizzie is still confused by the touch of his hand and frowns to herself.\n36 EXT. COUNTRY ROAD - DAY.\nThe Bennet's carriage is stopped in its tracks by a company of the Militia who are crossing\nin front of them.\n37 INT. CARRIAGE - COUNTRY ROAD - DAY.\nA few of the soldiers look in at the Bennet girls with some interest. Leading them is\nWICKHAM, a very handsome blonde officer. Lydia spots him and swoons.\nLYDIA: I can't believe it! They're close enough to touch! KITTY: I think one of them just\nwinked at me_ LYDIA: Oh! See! The blonde! Oh, be still my beating heart!\nLIZZIE: (to the coachman) Thomas, can't you drive around them?\nTo loud protest from Lydia and Kitty the carriage veers off.\n38 INT. LONGBOURN - HERTFORDSHIRE - DAY.\nAs the Bennet girls come into the house, Lydia eulogizing the Militia, they meet Mr\nBennet. [and Mrs. Bennet orders Betsy to buy meet, which line has been cut]\nLYDIA: There was one with great long lashes, like a cow, did you see him? He looked right\nat me.\nMR BENNET: I hope, my dear, that you have ordered a good dinner today, because I have\nreason to expect an addition to our family party.\nMr Bennet holds up a letter. 39 INT. CARRIAGE - COMING THROUGH MERYTON -\nDAY. [carriage scene has been cut]\nMR COLLINS (late twenties) an overweening sychophant, nervous and unctuous in equal\nmeasure, sits in his black garb, hunched uncomfortably as he comes through town.\nMR COLLINS (V.O.) Dear sir, the disagreement over the entail to me of the Longbourn\nestate, has been a subject of torment which I wish to heal. Having received ordination this\nEaster and being so fortunately distinguished by the patronage of the Right Honorable Lady\nCatherine de Bourgh...\"\nMr Collins's voice fades out as his carriage wipes through frame revealing Lizzie and\nCharlotte on their way to the butchers.\n LIZZIE: His name is Mr Collins. He's the dreaded cousin.\nCHARLOTTE: Who's to inherit?\nLIZZIE: Indeed. Everything, apparently. He may leave us our stays, but even my piano\nstool belongs to Mr Collins.\nCHARLOTTE When?\nLIZZIE: He can turn us out of the house as soon as he pleases.\nCHARLOTTE: But why?\nLIZZIE: Because the estate is entailed to him and not to us poor females.\nA cart passes, crammed with sheep going to slaughter. They baa plaintively. [I didn't\nnotice one]\n40 INT. HALLWAY - LONGBOURN - DAY. [scene reduced to Mr. Collins introducing\nhimself]\nMr Collins is ushered in by the manservant, Giles. He looks around his fut ure home with\ninterest.\nMr and Mrs Bennet greet him.\nMR COLLINS: (deep bow ) Mr Collins, at your service.\n41 INT. DINING ROOM - LONGBOURN - EVENING.\nThe Bennets and Mr Collins are seated formally for supper. Mr Collins is served some food.\nMR COLLINS What a superbly featured room and what excellent boiled potatoes. It is many\nyears since I had such an exemplary vegetable. To which of my fair cousins should I\ncompliment the excellence of the cooking?\nMRS BENNET: Mr Collins, we are perfectly able to keep a cook.\nMR COLLINS: What a blessing.l am honoured to have, as my patroness, Lady Catherine de\nBourg, you have heard of her, I presume?\nMrs Bennet shakes her head.\nMR COLLINS: (cont'd) My small rectory abuts her estate, Rosings Park, and she of ten\ncondescends to drive by my humble dwelling in her little phaeton and ponies.\nA pause. Lizzie catches her father's eye.\nMRS BENNET: Does she have any family?\nMR COLLINS: One daughter, the heiress of it all and a creature of such superior graces she\nseems born to greatness. (little cough) These are the kind of little, delicate compliments\nthat are always acceptable to ladies, and which I conceive myself particularly bound to pay.\nMR BENNET: (gravely) How happy for you, Mr Collins, to possess the talent for flattering\nwith such delicacy.\nMr Collins nods with satisfaction.\nLIZZIE: Do these pleasing attentions proceed from the impulse of the moment or are they\nthe result of previous study?\nJane kicks Lizzie under the table. Lizzie tries not to laugh at Mr Collins' answer.\n MR COLLINS: They arise chiefly from what is passing at the time, and though I sometimes\namuse myself with arranging such little elegant compliments, I always wish to give them as\nunstudied an air as possible.\nLIZZIE: Believe me, no one would suspect your manners to be rehearsed.\nLydia suddenly lets off a little explosion of hysteria. A fierce look from Lizzie quells it and\nKitty pats her on the back solicitously.\nMR COLLINS: After dinner I thought I might read to you all for an hour or two. I have with\nme Fordyce's sermons, which speak eloquently on all matters moral. (to Jane) Do you know\nFordyce's sermons Miss Bennet?\n42 INT. CORRIDOR/DRAWING ROOM - LONGBOURN - LATER.\nWe can see the girls and Mr Bennet gathered by the fire through the doorway. Mr Collins\nleaves the room and takes Mrs Bennet aside to a very discreet conference, out of hearing of\nanyone else.\nMR COLLINS: Mrs Bennet. You do know I have been bestowed by the good grace of Lady\nCatherine de Bourg a parsonage of no mean size.\nMRS BENNET: I have become aware of the facto\nMR COLLINS: Well, it is my avowed hope that soon I may find a mistress for it, and I have\nto inform you that the eldest Miss Bennet has captured my special attention.\nMr Collins looks lasciviously into the room.\nMRS BENNET: Mr Collins, unfortunately it incumbent on me to hint that eldest Miss Bennet\nis - very soon to be engaged.\nMR COLLINS: Engaged!\nMRS BENNET: But Miss Lizzie next to her in both age and beauty would make anyone an\nexcellent partner. Do not you agree, Mr Collins?\nMr Collins looks through the doorway at Lizzie\nMR COLLINS: Indeed. Indeed. A very agreeable alternative.\n[Scene 42 has been cut]\n42. EXT. BACK GARDEN MEADOW - LONGBOURN - DAY.4\nMr Collins appears through a door to the yard. He spots Jane and Lizzie and advance\ntowards them.\nLlZZIE: No, no! Quick! This way!\nShe pulls Jane across the duck board spanning the moat. Mr Collins comes out into the\nback garden. The girls are nowhere to be seen. He looks around, puzzled, as we reveal\nLizzie and Jane hiding behind the moat wall.\n[the following scene has been altered: it shows Meryton, not the girls, you hear\nLizzy say: \"A man like Mr. Collins makes one despair for the entire sex...\"]\n 43 EXT. MERYTON VILLAGE - DAY.\nLizzie, holding Jane's hand, is still running and laughing as she goes. Jane is grumbling,\nholding onto her bonnet.\nJANE: Oh do stop, Lizzie, l've got no more breath!\nLizzie slows, turning around to laugh at Jane, then turning back and practically winding the\ntall, blonde officer spotted earlier by Lydia. He stands before her, holding a handkerchief\nthat's down fluttered from her sleeve, a witty curl on his exquisite mouth.\nWICKHAM Yours, I believe?\nLizzie is, for a moment, speechless, but then nods and takes the kerchief as Kitty and Lydia\nrush up from behind Wickham.\nLYDIA: Oh how perfect you are, Mr Wickham!\nKITTY: He picked up my glove, too. Did you drop yours on purpose, Lizzie? LYDIA: Mr\nWickham's a lieutenant.\nWICKHAM: An enchanted lieutenant.\nJANE: What are you up to, Liddy?\nLYDIA: We just happened to be looking for some ribbon\nKITTY: White, for the ball!\nWICKHAM: Shall we all look for some ribbon together?\nWickham's wry tone tells Lizzie that he perfectly understands her silly sisters.\n45 INT. MILLINER'S SHOP - DAY.\nThey come into the shop. The others go towards the counter. Wickham hangs back, and\nsmiles a complicit, witty smile at Lizzie.\nWICKHAM: I shan't even browse. I can't be trusted. I have very poor taste in ribbons.\nLIZZIE: (gravely) Only a man truly confident of himself would admit that.\nWICKHAM: No, it's true. And buckles. When it comes to buckles, I'm lost.\nLIZZIE: Dear oh dear. You must be the shame of the regiment.\nWICKHAM: A laughing-stock.\nLIZZIE: What do your superiors do with you?\nWICKHAM: Ignore me. I'm of next to no importance, so it's easily done.\nOn the contrary, Wickham is almost impossible to ignore. Lizzie tears her eyes from his\nwinsome features as Lydia grabs her sleeve. .\nLYDIA: Lizzie, lend me some money!\nLIZZIE: You already owe me a fortune, Liddy.\nWICKHAM: Allow me to oblige.\nLIZZIE: No! Please - Mr Wickham\nWickham gives Lizzie a smile and moves away to the counter.\n46 EXT. ROAD TO MERYTON - DAY. [we don't see Wickham scything cow-parsley\nnor discussing the French with Lizzy]\n Wickham is escorting the girls home. He's scything down cow-parsley with his sword, as\nLydia and Kitty wave yards of ribbon about. It's impossible not to admire the cut of\nWickham's jib as darts athletically about the undergrowth. Lizzy is almost as fizzly as her\nsisters. Jane watches them all with her benevolent smile.\nWICKHAM: Take that, you cur! And that, and that!\nMore cow-parsley bites the dust.\nLIZZIE: I pity the French.\nWICKHAM: Oh so do I. Miserable bunch. Small, swarthy and that tinv Emperor.\nLizzie laughs.\nJANE Look! Mr Bingley.\nMr Bingley and Darcy are riding towards them. Bingley pulls in his horse, jumps down and\nhurries over, his open friendly face filled with delight. Darcy stays astride, staring at\nWickham, who suddenly sheaths his sword and looks at the ground. Lizzie watches him. His\neyes dart up to Darcy and away again. Darcy's face is dark and closed.\nBINGLEY: I was on my way to your house.\nLYDIA: Mr Bingley, how do you like my ribbons for your ball?\nBingley is gazing at Jane.\nBINGLEY Very beautiful.\nLYDIA: She is! Look at her! She's blooming\nJANE: Lydia!\nBut Lydia dances around Bingley like Squirrel Nutkin, waving her ribbons in his face.\nLYDIA: Be sure to invite Mr Wickham, he's a credit to his profession.\nDarcy turns and rides off without a word. Lizzie watches, fascinated as Wickham recovers\nhimself.\nJANE: Lydia you can't invite people to other people's ball.\nBINGLEY: Of course you must come, Mr Wickham. Ladies, excuse me. Enjoy the day.\nBingley bows, principally to Jane, and jumps back on his horse. Lizzie turns to Wickham,\nbut he has walked ahead. The mood of the day has changed completely and Lizzie starts to\nfollow him thoroughly puzzled. 47 EXT. ROAD TO MERYTON - DAY. [in the movie this\nscene starts with Lizzy asking Wickham \"Will you come to the ball...\"]\nRather tired after their strenuous flirting, Lydia and Kitty haved linked arms with Jane and\nmoaning about the walk as they pass us.\nKITTY: My feet hurt.\nLYDIA: I hate this walk. It's always too far.\nJANE: Nearly there.\nLizzie is walking next to Wickham, who's looking depressed.\n LIZZIE: Will you come to the Netherfield ball then, Mr Wickham?\nWICKHAM: Ah. Perhaps. How long has Mr Darcy been a guest there?\nLIZZIE: About a month. Forgive me but are you acquainted with him? With Mr Darcy?\nWICKHAM: Indeed, I have been connected with his family since infancy.\nLizzie is genuinely surprised.\nWICKHAM: (cont'd) You may well be surprised, Miss Bennet, especially given our cold\ngreeting this afternoon.\nLIZZIE: I hope your plans in favour of Meryton will not be affected by your difficult relations\nwith the gentleman.\nWICKHAM: Oh no - it is not for me to be driven away. If he wishes to avoid seeing me, he\nmust go not I.\nPause.\nLIZZIE: I must ask you Mr Wickham, what is the manner of your disapproval of Mr Darcy?\nWICKHAM: Do you really want to hear?\nLizzie tries not to nod too vehemently.\nWICKHAM (cont'd) He ruined me.\nShe stares at him.\nLIZZIE: How so?\nWICKHAM: My father managed his estate. We grew up together, Darcy and I. His father\ntreated me like a second son. Oh he was the kindest of men and bequeathed me the best\nliving in his gift, for I had my heart set on joining the church. But when he died Darcy\nignored his wishes and gave the living to another man.\nLIZZIE: Why did he do that?\nWICKHAM: Out of jealousy, for his father loved me more than he loved him.\nLIZZIE: Cruel! Cruel! Are you sure?\nWICKHAM: (nods) And out of pride, for he considered me too lowly to be worth his\nconsideration.\nPause. Lizzie gazes at him with horror and sympathy.\n48 INT. KITTY & LYDIA'S BEDROOM - LONGBOURN - DAY.\nWe pan through the bedrooms as the Bennet girls prepare for the Netherfield balI. Betsy is\nhelping Lydia and Kitty into their dresses, they are both wearing white.\nLYDIA: Aggghh!\nKITTY Breathe in!\n49 INT. LIZZIE & JANE'S BEDROOM - LONGBOURN - DAY.\nWe move to the quieter preparations of Jane and Lizzie. Jane is taking the curlers out of\nLizzie's hair. We have never seen Lizzie pay such attention to her appearance.\nJANE: - I still think there must have been a misunderstanding.\nLIZZIE: (exasperated laugh) Oh Jane, do you never think ill of anybody?\n JANE: How could Mr Darcy do such a thing? I will discover the truth from Mr Bingley at the\nbalI this evening.\nLIZZIE: If it is not true let Mr Darcy contradict it himself. But until he does, I hope never to\nencounter him.\nJANE: Poor, unfortunate Mr Wickham.\nLIZZIE: On the contrary, he is twice the man Darcy is.\nJANE: And let us hope, a rather more willing dancer.\nJane leaves Lizzie at the mirror taking very particular care of her toilette. She smiles to\nherself.\n50 EXT/INT. NETHERFIELD - DUSK.\nA long queue has formed to gain entrance to the ball. There are hundreds of guests. All the\nwomen are dressed in shades of off-white. The men are either in red officer uniform or\ndressed in black and white. We move up the queue to the front door where Bingley and\nCaroline are greeting their guests.\nThe Bennets are next in line and step up. Bingley beams at Jane.\nBINGLEY: You're here! I'm so pleased.\nJANE: And so am I.\nBINGLEY: How are you, Miss Elizabeth?\nLizzie is not paying attention, instead she is searching over Mr Bingley's shoulder for a sight\nof Wickham.\nBINGLEY: (cont'd) Are you looking for someone?\nLIZZIE: No, no not at all, admiring the general splendour.\nJANE: It is breath-taking, Mr Bingley.\nThe Bennet's are forced to move on into the house. Mrs Bennet talks while we focus on\nLizzie searching the sea of red coats.\nMRS BENNET: I dare say, I have never met a more pleasant gentleman in all my years. Did\nyou see how he dotes on her! Dear, dear Jane. Always doing what is best for her family.\nLizzie slips away into the next room. She walks into the dining room, which has been\nconverted into a ball room and where numerous couples are dancing while others crowd the\nedges to watch. Lizzie thinks she sees Mr Wickham among the dancers, she moves to get a\nclearer view. The MAN turns round - but is not Wickham.\nCharlotte approaches her through the crowd.\nLIZZIE: Have you seen Mr Wickham?\nCharlotte shakes her head.\nCHARLOTTE Perhaps he is through here.\n51 INT. NETHERFIELD - DRAWING ROOM - NIGHT\n Lizzie and Charlotte enter the drawing room. Jane appears and catches lizzie's arm.\nJANE: He's not here. Apparently otherwise detained.\nThe disappointment is palpable.\nLIZZIE: Detained?\nMr Collins arrives, breathless. He smiles eagerly at Lizzie.\nMR COLLINS: There you are.\nLIZZIE: Mr Collins. What a pleasant surprise.\nMR COLLINS Perhaps you will do me the honour, Miss Lizzie?\nLIZZIE: Oh. I didn't think you danced, Mr Collins.\nMR COLLINS: I do not consider it incompatible with the office of a clergyman to indulge in\nsuch an innocent diversion.\nLizzie tries to smile politely.\nMR COLLINS: (cont'd) In fact several people, her ladyship included, have complimented me\non my lightness of foot.\nLizzie's smile congeals.\n52 INT. DINING ROOM/BALLROOM - NETHERFIELD - NIGHT\nLizzie dances with Mr Collins. The style of the dance is not unlike English Country dancing.\nMR COLLINS: To be sure/ dancing is of little consequence to me, but it does afford the\nopportunity to lavish one's partner with delicate attentions which is my primary object of\nthe evening.\nLizzie turns as part of the dance and for a moment she dances beside Jane.\nJANE: Apparently your Mr Wickham has been called on some business to town, though my\ninformer told me he would have been less inclined to be engaged had it not been for the\npresence at Netherfield of a certain gentleman.\nJane indicates towards where Darcy stands watching them.\nLIZZIE: That gentleman barely warrants the name.\nThe dance leads Lizzie back to Mr Collins.\nMR COLLINS: It is my intention, if I may be so bold to remain close to you throughout the\nevening.\n53 INT. STAIRCASE - NETHERFIELD - NIGHT.\nLizzie and Charlotte come out of the drawing room laughing and run straight into Mr Darcy.\nDARCY: May I have the next dance, Miss Elizabeth?\n Lizzie is stunned.\nLIZZIE: You may.\nDarcy walks away.\nLIZZIE: (cont'd) Did I just agree to dance with Mr Darcy?\nCHARLOTTE: I dare say you will find him very amiable, Lizzie.\nLIZZIE: Which would be most inconvenient since I have sworn to loathe him for all eternity.\n54 INT. DINING ROOM/BALLROOM - NETHERFIELD - NIGHT.\nLizzie dances face to face with Darcy. Neither can speak. They dance for a moment in\nsilence.\nLIZZIE: I love a Sarabande.\nDARCY: Indeed. Most invigorating.\nThey continue, for a moment, in silence.\nLIZZIE It is your turn to say something, Mr Darcy - I talked about the dance, now you\nought to remark on the size of the room or the number of couples.\nDARCY: I am perfectly happy to oblige, please advise me of what you would like most to\nhear.\nLIZZIE: That reply will do for the present. Perhaps by and bye I may observe that private\nballs are much pleasanter than public ones. But for now we may be silent.\nDARCY: Do you talk as a rule while dancing?\nLIZZIE: (slightly irritable) No, no - I prefer to be unsociable and taciturn. That makes it all\nso much more enjoyable, don't you think?\nDarcy ponders this critique of his social skills a moment.\nDARCY: Tell me, do you and your sisters very of ten walk to Meryton?\nThey are suddenly parted by the choreography of the dance. We stay with Lizzie who is\nwhisked round the floor by AN ELDERLY MAN, who smiles at her toothlessly. Lizzie looks\nback at Darcy who is dancing with Lydia. He stare at Lizzie as he dances. Lizzie smiles at\nher current partner in embarrassment. [This scene has been cut]\nLIZZIE: Very mild weather we've been having.\nELDERLY MAN: (deaf as a post) I prefer them soft-boiled.\n[These lines have been cut]\nThe dance spins again and she is back with Darcy.\nLIZZIE: Yes, we of ten walk to Meryton it is a great opportunity to meet new people. In fact\nwhen you met us we had just had the pleasure of forming a new acquaintance.\nDARCY: Mr Wickham is blessed with such happy manners he is sure of making friends -\nwhether he is capable of retaining them is less certain.\nLIZZIE: He has been so unlucky as to lose your friendship. And I dare say that is an\nirreversible event?\nDARCY: It is.\n Darcy's face is closing up. But he can't help himself.\nDARCY:    (cont'd) Why do you ask such a question?\nLIZZIE:  To make out your character, Mr Darcy.\nDARCY:    And what have you discovered?\nLIZZIE:  Very little.\nThe dance finishes.\nLIZZIE: (cont'd) I hear such different accounts of you as puzzle me exceedingly.\nDARCY: I hope to afford you more clarity in the future.\nThey bow to each other, the tension between them almost palpable. Lizzie moves quickly\naway, deeply unsettled. A breathless Mr Collins appears.\nMR COLLINS: Is that Mr Darcy, of Pemberley in Derbyshire?\nLIZZIE I believe so.\nMR COLLINS: But I must make myself known to him immediately!\nLIZZIE: But sir\nMR COLLINS: He is the nephew of my esteemed patroness, Lady Catherine.\nLIZZIE: (surprised) He is?\nMr Collins starts making his way determinedly towards Darcy.\nLIZZIE: (cont'd) Please, Mr Collins! He'll consider it an impertinence\nLizzie watches from a distance, with acute embarrassment, as Mr Collins interrupts Darcy.\nDarcy does not notice him, so Mr Collins raises his voice.\nMR COLLINS: Mr Darcy!\nThe room around him stops. Darcy is surprised and turns round. In dumbshow we see,\nduring the conversation, Mr Collins point Lizzie out to Darcy, who looks horrified by Mr\nCollins's obsequiousness.\nCaroline sidles up to Lizzie.\nCAROLINE: What interesting relatives you have, Miss Bennet.\nLizzie walks away into another room.\n55 INT. NETHERFIELD - NIGHT. [montage and dialogue slightly altered]\nMONTAGE: A blurry vision of the goings-on as the night passes. Kitty and Lydia giggling\ninsanely. Mary singing, badly, at the piano. Mrs Bennett tipping a glass of punch over\nsomeone. Mr Bennett snoozing behind a pillar. Mrs Bennett watching Jane and Bingley.\nDarcy passes behind her and overhears.\nMRS BENNETT: Oh yes, we fully expect a most advantageous marriage.\nBingley staring at, Jane, who sits, demure as ever, watching a dance. Elizabeth and\nCharlotte watching Jane.\n CHARLOTTE: She should move fast. Snap him up. There is plenty of time to get to know\nthem after you're married.\nCaroline dancing with Darcy. She chats on. He is silent. Mr Collins following Lizzie about like\nsome ancient duckling. Lizzie escaping onto the terrace and trying to calm down and\nbreathe.\n[The conversation between Lizzy and Charlotte on Jane's attitude and feelings is\nnot in this script]\n56 SCENE DELETED\n57 INT. ENTRANCE HALL - NETHERFIELD - THE WEE HOURS [this scene has been cut]\nDay light creeps through the curtains. Lydia and Kitty have dragged the last surviving fiddle\nplayer into hall and propped against door frame. He now plays as they dance with each\nother. Mrs Bennet is sprawled on a sofa. Jane sitting demurely. Collins looking longingly at\nLizzie. Bingley is standing, the perfect host, but obviously willing the Bennets to leave. Mrs\nBennet holds court.\nMRS BENNET: I have never had such a good time in my life. Mr Bingley you must have\nsuch a ball once a month at least.\nCaroline who is standing with her brother, yawns ostentatiously.\nLIZZIE: Mother. I really think it is time to go.\nMRS BENNET: Don't be impertinent. Our hosts are perfectly happy with our company, are\nyou not, Mr Bingley? I hope I can entice you to Longbourn to sample our hospitality. We\nwould make sure you had 3 or 4 courses at least.\nShe holds out her glass for a top up and carries on.\nMRS BENNET: (cont'd) So tell me Mr Bingley. Whom did you like least of all your guests\nthis evening?\nLIZZIE Really. This is enough.\nDarcy looking down at Lizzie from a staircase. He turns and walks away.\n58 EXT. NETHERFIELD DRIVE - HERTFORDSHIRE - MORNING.\nBingley and Caroline are waving off the Bennett carriage. Bingley is grey with fatigue.\nCaroline looks at his plaintive expression and then looks at the departing carriage\nCAROLINE: My dear Charles - you can't be serious.\nBingley shoots her a look and goes into the house in a huff.\nMRS BENNET: (V.O.) We will be having a wedding here at Netherfield in less than three\nmonths, if you ask me. Mr Bennet? Mr Bennet!\n59 INT. BREAKFAST ROOM - LONGBOURN - DAY.\n The Bennets eat in silence. Jane yawns. Mrs Bennet moans she is hungover. Mr Collins\ncomes in, in a state of agitation. They look at him. He sits, hesitates, then asks:\nMR COLLINS: Mrs Bennet - I was hoping, if it would not trouble you, that I might solicit a\nprivate audience with Miss Lizzie in the course of the morning.\nLizzie is open mouthed.\nMRS BENNET: Oh! Yes. Certainly - Lizzie would be very happy indeed. Everyone. Out. Mr\nCollins would like a private audience with your sister.\nEveryone looks in amazement.\nLIZZIE: Wait. I beg you. Mr Collins can have nothing to say to me that anybody need not\nhear.\nMRS BENNET: No. Nonsense, Lizzy. I desire you will stay where you are. Everyone else, to\nthe drawing room. Mr Bennet.\nMR BENNET: But...\nMRS BENNET: Now!\nMrs Bennet whooshes everyone out, winks at Mr Collins then shuts the door before Lizzie\nhas time to do anything. Lizzie looks at Mr Collins who looks at her earnestly. There is a\nhorrible pause of intense embarrassment.\nMR COLLINS: Dear Miss Elizabeth, 1 am sure my attentions have been too marked to be\nmistaken. Almost as soon as I entered the house I singled you out as the companion of my\nfuture life.\nLizzie stares at him, astonished.\nMR COLLlNS: (cont'd) But before I am run away with my feelings perhaps I may state my\nreasons for marrying. Firstly, that it is the duty of a clergyman to set the example of\nmatrimony in his parish. Secondly, that I am convinced it will add greatly to my happiness,\nand, thirdly, that it is at the urging of my esteemed patroness Lady Catherine that I select\na wife.\nWe hear a kick and Kitty screech from behind the door.\nMRS BENNET: (V.O.) Sshhh.\nMR COLLINS My object in coming to Longbourn was to choose such a one from Mr Bennet's\ndaughters, for I am to inherit the estate and such an alliance will surely suit everyone.\n(drops to his knee) And now nothing remains for me but to assure you in the most\nanimated language of the violence of my affections.\nLIZZIE: Mr Collins\nMR COLLINS: And that no reproach on the subject of fortune will cross my lips once we are\nmarried.\nLIZZIE: You are too hasty, sir! You forget that I have made no answer.\nMR COLLINS: (unperturbed) I must add, that Lady Catherine will thoroughly approve, when\nI speak to her of your modesty, economy and other amiable qualities.\nLIZZIE: Sir, I am honoured by your proposal, but regret I must decline it.\nMR.COLLINS: (momentarily taken aback, but recovering) I know ladies don't seek to seem\ntoo eager.\n LIZZIE: (in some desperation) Mr Collins, I am perfectly serious. You could not make happy\nand I'm convinced I'm the last woman in the world who could make you happy.\nMR COLLINS: (pause) I flatter myself, cousin, that your refusal is merely a natural delicacy.\nAnd as it is by no means certain that another offer of marriage may ever be made to you.\nLIZZIE: (rising, deeply affronted) Mr Collins -\nMR COLLINS: I must conclude that you simply seek to increase my love by suspense,\naccording to the usual practice of elegant females.\nLIZZIE: Sir! I am not the sort of female to torment a respectable man. Please understand\nme - I cannot accept you!\nLizzie storms out of the room and out of the house. Mrs Bennet crashes in through another\ndoor, hot on the tail of Lizzie.\nMRS BENNET: Oh headstrong, foolish child\nMR COLLINS: Head strong?\nMRS BENNET: - don't worry Mr Collins, we shall have this little hiccup dealt with\nimmediately.\nMrs Bennet goes after Lizzie. Mr Collins watches through a window as Lizzie is pursued by\nher mother. 60 INT. LIBRARY - LONGBOURN - THE SAME.\nMrs Bennet marches into the library. Mr Bennet looks up in shock.\nMRS BENNET: Oh Mr Bennet. We are all in a uproar. You must come and make Lizzie marry\nMr Collins, for she vows she will not have him.\nMr Bennet stares at Mrs Bennet blankly.\nMRS BENNET: (cont'd) Mr Collins has proposed to Lizzie. But Lizzie declares she will not\nhave him, and now the danger is Mr Collins may not have Lizzie.\nMR BENNET: And what am I to do?\nMrs Bennet drags Mr Bennet to his feet.\nMRS BENNET Speak to Lizzie.\nThey march to find Lizzie, passing Mr Collins in the dining room. [location in the movie\naltered]\n61 INT. DRAWING ROOM - LONGBOURN - THE SAME. [location altered]\nMr Bennet and Mrs Bennet confront Lizzie, who has been waiting in the drawing room.\nPerhaps the other girls form an audience from the stairs, Mr Collins looks on sheepishly\nfrom the breakfast room.\nMRS BENNET: Tell her that you insist upon them marrying.\nLIZZIE: Papa, please - !\nMRS BENNET: You will have this house!\nLIZZIE: I can't marry him!\nMRS BENNET: You'll save y6ur sisters from destitution!\nLIZZIE: I can't!\nMRS BENNET: Go back now and say you've changed your mind!\nLIZZIE: No!\n MRS BENNET Think of your family!\nLIZZIE: You can/t make me!\nMRS BENNET: Mr Bennet, say something!\nMR BENNET: (to Lizzie) SO, your mother insists on you marrying Mr Collins.\nMRS BENNET: Yes, or I shall never see her again!\nMR BENNET: Well Lizzie. From this day on 'you must be a stranger to one of your parents.\nMRS BENNET: (to Lizzie) - who will maintain you when your father is dead?\nMR BENNET: Your mother will never see you again if you do not marry Mr Collins, and I will\nnever see you again if you do.\nMRS BENNET: Mr Bennet!\nLIZZIE: Thank you, papa.\nLizzie turns around and walks into the hall.\n62 INT. HALL STAIRS - LONGBOURN - THE SAME\nLizzie walks through the other sisters who are gathered at the door but stops when she\nreaches Jane sitting on the stairs. Her face is white. There's a letter in her hand. Mrs\nBennet charges out and speaks to anyone who will listen.\nMRS BENNET: Oh, ungrateful child! I shall never speak to her again! Not that I have much\npleasure in talking to anybody. People who suffer as I do from nervous complaints can have\nno inclination for talking. Nobody can tell what I suffer...\nShe jabbers on but her voice fades. We're with Jane, rereading the letter.\nLIZZIE: What's wrong, Jane?\nClose on Jane's pale face. She's staring at the letter.\nMRS BENNET: (distant) But it is always so. Those who complain are never pitied. . .\nINT. CARRIAGE - LEAVING NETHERFIELD - THE SAME.\nBingley, Caroline and Darcy sit grimly in a carriage as it drives away from Netherfield.\nDarcy looks severe and stern, Caroline can't help a little smirk on her face. Bingley looks\nback longingly.\n64 EXT/INT. NETHERFIELD - DAY.\nThe footman walks back into the house. Inside the furniture is being covered with dust\nsheets. The footman closes the heavy doors.\n65 INT. BEDROOM - LONGBOURN - NIGHT.\nLizzie is packing a case for Jane while Jane sits on the bed.\nLIZZIE: I don't understand. What would take him from Netherfield? Why would he not know\nwhen he was to return?\nJANE: Read it. I don't mind.\nJane passes Lizzie the letter.\n LIZZIE: \"Mr Darcy is impatient to see his sister and we are scarcely less eager to meet her\nagain. I really do not think Georgiana Darcy has her equal for beauty, elegance and\naccomplishments, so much so I must hope to hereafter call her my sister.\"\nJANE: Is that not clear enough?\nLIZZIE: Caroline sees that her brother is in love with you and has taken him off to persuade\nhim otherwise.\nJANE: But I know her to be incapable of wilfully deceiving anyone. It is far more likely that\nhe does not love me and never has.\nLizzie slams shut the lid of the case with rather more force than is necessary.\nLIZZIE: He loves you, Jane. Do not give up. Go to our aunt and uncle's in London. Let it be\nknown you are there and I am sure he will come to you.\n66 EXT. LONGBOURN - DAY.\nJane is in a carriage. Mrs Bennet kisses her goodbye through the window as all the Bennet's\nlook on.\nMRS BENNET: Give my love to my sister. And try not to be a burden, dear.\nJane's carriage moves away and the family wave. Mr Bennet talks to Lizzie.\nMR BENNET: Poor Jane. However, a girl likes to be crossed in love now and then. It gives\nher something to think of, and a sort of distinction among her companions.\nLIZZIE: (dryly) I'm sure that will cheer her up, Papa.\n[dialogue between Lizzie and Mr. Bennet is a little longer in the movie] 67 INT.\nBEDROOM - LONGBOURN - DAY [Different location in the movie: Lizzie sits on a\nswing in the courtyard]\nLizzie is making the bed and tidying Jane's belongings.\nDISSOLVE TO: Lizzie sits on the bed. There is a knock at the door and Charlotte enters.\nCHARLOTTE: My dear Lizzie, I've come here to tell you the news. Mr Collins and I are\nengaged.\nLizzie stands up very suddenly.\nLIZZIE: Engaged?\nCHARLOTTE: Yes.\nLIZZIE: To be married?\nCHARLOTTE: Yes of course, Lizzie, what other kind of engaged is there?\nLizzie just stares at her. Charlotte, who is in a state, makes an impatient gesture towards\nher.\nCHARLOTTE: (cont'd) Oh for heavens sake, Lizzie, don't look at me like that. There's no\nearthly reason why I shouldn't be as happy with him as any other.\nLIZZIE: But he's ridiculous.\nCHARLOTTE: Oh hush. Not all of us can afford to be romantic. I've been offered a\ncomfortable home and protection, there's a lot to be thankful for.\n LIZZIE: Charlotte\nCHARLOTTE: I'm twenty-seven years old. I'm plain and I have no money and no prospects.\nI'm already a burden to my parents and I'm frightened. So don't judge me, Lizzie, don't\nyou dare judge me.\nIn something of passion, Charlotte leaves the room. Lizzie makes a kind of choking noise in\nher throat, but she doesn't cry.\nWe hear the sound of the militia drums... [Not in the movie]\n68 EXT. MERYTON - DAY. [Scene cut except for Lizzie (V.O) reading her letter to\nCharlotte]\nThe militia are leaving Meryton. Hundreds of soldiers and officers in the red coats marching\nout of the village to the sound of' pipes and drums. The villagers are out to bid them\nfarewell. Lydia and Kitty run through the crowds very distraught. They find Lizzie coming in\nthe other direction.\nLYDIA: They're leaving for Brighton. I want to die.\nLIZZIE: All of them?\nKITTY: They got the call this morning.\nLYDIA: Not a word of warning!\nLydia wails. Lizzie searches the red coats for Wickham. She spots him, he glances across at\nher I she gives a pathetic wave and he's gone. Lydia and Kitty chase the last of the officers,\nthe crowds disappear and Lizzie is left alone. We begin to hear Lizzie reading a letter in\nvoice over.\nLIZZIE: (V.O.) Dear Charlotte, I am so glad the house, furniture,neighbourhood and roads\nare all to your taste\nLizzie's pattens make a lonely clopping as she walks away.\n69 EXT. HUNSFORD PARSONAGE - KENT - DAY.\nLizzie's carriage arrives at a smallish but charming rectory in Kent. This is Hunsford,\nCharlotte's new home. She rushes out and greets Lizzie, kissing her nervously.\nLIZZIE: (V.O.)- and that Lady Catherine's behaviour is friendly and obliging. As for the\nfavour you ask, it is no favour at all, I would be glad to visit you at your earliest\nconvenience.\nMr Collins bows and ushers her in.\nMR COLLINS Welcome to our humble abode.\n70 INT. HUNSFORD PARSONAGE - DAY.\nMr Collins carries Lizzie's luggage into the narrow hall.\nCHARLOTTE: My dear, I think our guest is tired after her journey.\nMR COLLINS: My wife encourages me to spend as much time in the garden as possible, for\nthe sake of my health.\n A beat. Lizzie glances at Charlotte, who remains impassive.\nMR COLLINS: (cont'd) I plan many improvements, of course. I intend to throw out a bow\nand plant a lime walk. (sharp look at Lizzie) Oh yes, I flatter myself that any young lady\nwould be happy to be the mistress of such a house.\nA tiny nod from Lizzie. She understands perfectly. 71 INT. CHARLOTTE'S PARLOUR -\nHUNSFORD - DAY.\nLizzie and Charlotte are at last alone. They sit down in a charming little parlour that faces\nthe front of the house. Charlotte pours out tea.\nCHARLOTTE: We shall not be disturbed here, this parlour is for my own particular use. (a\nbeat). Oh Lizzie, it's such a pleasure, to run my own home!\nLizzie nods uncomfortably.\nMR COLLINS (OOV) Charlotte! Come here!\nCharlotte jumps up and rushes to the window.\nLIZZIE: ( alarmed) What's happened?\nMR COLLINS: (OOV) Charlotte!\nCHARLOTTE: (jumps up) Has the pig escaped again?\nOutside in the lane, Mr Collins stands, bowing: at a carriage.\nCHARLOTTE: (cont'd) Oh! It's Lady Catherine. Come and see, Lizzie!\nLizzie goes to the window, unnerved by her friends enthusiasm. Mr Collins rushes back\ntowards the house and talks to them through an open window.\nMR COLLINS: Great news! Great news! We have an invitation to visit Rosings this evening\nfrom Lady Catherine de Bourg.\nCHARLOTTE How wonderful!\nLizzie tries to feign pleasure.\nMR COLLINS: Do not make yourself uneasy, my dear cousin, about your apparel.\nCHARLOTTE: Just put on whatever you've brought that's best.\nMR COLLINS: Lady Catherine has never been averse to the truly humble.\nLizzie stares at them both in disbelief.\n72 EXT. GROUNDS OF ROSINGS - EVENING.\nLizzie, Charlotte and Mr Collins walk hurriedly across a bridge towards the great house. The\ngrey building looms ominously above them. It is grand without being elegant.\nMR COLLINS: One of the most extraordinary sights in all Europe, is it not. The glazing alone\ncost upwards of twenty thousand pounds.\n 73 INT. GLAZED PASSAGE PAST KITCHEN - ROSINGS - EVENING [Scene has been\ncut] Mr Collins leads Lizzie and Charlotte past a vast steaming kitchen.\n74 INT. SALON - ROSINGS - DUSK.\nThe salon at Rosings is spectacularly grand; hideously so. Heavy furniture, rows of\nSERVANTS. The three guests are shown in by the footman. Again, Mr Collins scrapes the\nfloor with his bow.\nMR COLLINS: Your Ladyship. (to the daughter) Miss de Bourg.\nLADY CATHERINE is a haughty, officious battle-axe. Her daughter, MISS DE BOURG, is a\nsickly, irritable-looking creature.\nLADY CATHERINE: So you are Elizabeth Bennet.\nLIZZIE I am, your ladyship.\nLADY CATHERINE: (looking her up and down) Hmm. (indicates her daughter) This is my\ndaughter.\nCHARLOTTE: (eagerly) It' s very kind of you to ask us to dine, Lady Catherine.\nLady Catherine ignores her.\nMR COLLINS: (whispers to Lizzie) The chimneypiece alone cost 400 pounds.\nBut Lizzie doesn't hear. Darcy walks into the room. freezes. Another man, FITZWILLIAM, is\nwith him.\nLIZZIE: Mr Darcy! What are you doing here?\nMR COLLINS: Mr Darcy! (another deep bow). I had no idea we would have the honour...\nA stiff bow from Darcy, who looks at Mr Collins as if he's something brought in by the dog.\nHe turns to Lizzie, trying to collect himself.\nDARCY: (bows ) Miss Elizabeth... I'm a guest here.\nLADY CATHERINE: (surprised and not delighted) You know my nephew?\nLIZZIE: Yes, madam, I had the pleasure of meeting your nephew in Hertfordshire.\nFitzwilliam, a much more easy-going chap, introduces himself.\nFITZWILLIAM: Colonel Fitzwilliam. How do you do?\nHe bows. Lizzie returns his smile gratefully. They move towards the dining room. Mr Collins\nleans towards Lizzie.\n[The last lines of this scene have been cut]\nMR COLLINS: (whispering) You know Mr Darcy is as good as engaged to Miss de Bourg?\nLIZZIE: Really? Caroline will be disappointed to hear that. (looks at the girl, and whispers\nto Charlotte) What a miserabIe little thing! They should suit each other perfectly.\nBut Charlotte's uneasy smile confirms to Lizzie that she has lost her friend in more ways\nthan one.\n 75 INT. DINING ROOM - ROSINGS - NIGHT.\nThe dining room is laid for a very grand dinner - footmen waiting, thousands of candles.\nLady Catherine seats herself at the he and of the table.\nLADY CATHERINE: Mr Collins! You can't sit next to your wife, get up. Move over there.\nAfter an awkward shuffle, Lizzie finds herself sitting next to Darcy. Only her own discomfort\nprevents her from noticing Darcy is by no means master of his responses to her.\nMR DARCY: I trust your family is in good health, Miss Bennet?\nLIZZIE They are, thank you. (pause) My eldest sister is currently in London, perhaps you\nhappened to see her there?\nMR DARCY: (awkward pause) I haven't been fortunate enough, no.\nLizzie looks at him. He colours slightly. Lady Catherine addresses Lizzie in a loud voice,\nfrom the head of the table.\nLADY CATHERINE: Do you play the pianoforte, Miss Bennet?\nLIZZIE: A little, ma'am, and very poorly.\nLADY CATHERINE: Oh. Do you draw?\nLIZZIE: No, not at all.\nLADY CATHERINE: Your sisters, do they draw?\nLIZZIE: Not one.\nLADY CATHERINE: Has your governess left you?\nLIZZIE: We never had a governess.\nMr Collins squirms in embarrassment. Darcy watches Lizzie, keenly.\nLADY CATHERINE: No governess? Five daughters brought up at home without a governess,\nI never heard such a thing! Your mother must have been quite a slave to your education.\nLIZZIE: (can't help smiling at this) Not at all, Lady Catherine.\nLADY CATHERINE: Mmmm. Are any of your younger sisters out in society?\nLIZZIE: Yes, ma'am. All.\nLADY CATHERINE: All! What, five out at once? Very odd! And you only the second the\nyounger ones out before the elders are married! Your youngest sisters must be very young.\nLIZZIE: Yes, my youngest is not sixteen. But I think it would be very hard on younger\nsisters, not to have their share of amusement because the elder is still unmarried. And to\nbe kept back on such a motive! It would hardly encourage sisterly affection.\nLADY CATHERINE: Upon my word, you give your opinion very decidedly for so young a\nperson. Pray, what is your age?\nLIZZIE: (smiles) With three younger sisters grown up, your Ladyship can hardly expect me\nto own to it.\nLady Catherine looks astonished. Mr Collins shifts in his seat, Lizzie's enjoying herself and\nDarcy's having great difficulty concealing his admiration.\n76 INT. SALON - ROSINGS - NIGHT.\nDinner is over and they are drinking coffee. Darcy moves towards Lizzie but Lady Catherine\ninterrupts, by shouting from her seat.\n LADY CATHERINE: Come, Miss Bennet, and play for us!\nLIZZIE: No, I beg you\nLADY CATHERINE: Music is my delight. In fact there are few people in England who have\nmore true enjoyment of music than myself, or better natural taste. If I had ever learnt, I\nshould have been a prodigy. (indicates daughter) So would Anne, if her health would have\nallowed her.\nLIZZIE: Lady Catherine, I am not afflicted with false modesty and when I say I play poorly\n...\nMR COLLINS: (hisses) Come come, Lizzie, her ladyship demands it!\nLizzie reluctantly sits down at the piano and starts to play. Lady Catherine takes no notice\nand talks loudly over the music.\nLADY CATHERINE: How does Georgiana get along, Darcy?\nDARCY: She plays very well.\nLADY CATHERINE: I hope she practises. No excellence can be acquired without constant\npractice. I have told Mrs Collins this. (turns to Charlotte) Though you have no instrument of\nyour own you are very welcome to come to Rosings and play on the piano in the\nhousekeeper's room. CHARLOTTE: Thank you, your ladyship. LADY CATHERINE: You would\nbe in nobody's way, you know, in that part of the house.\nDarcy flinches at her bad manners. He moves away to the piano where Lizzie is playing -\nnot that terribly well, it must be said. She's nervous, plays a wrong chord and then gets\nangry with herself and focusses.\nLIZZIE: You mean to frighten me, Mr Darcy, by coming in all your state to hear me, but I\nwon't be alarmed even though your sister does play so well.\nDARCY: I am well enough acquainted with you, Miss Bennet, to know I cannot alarm you\neven should I wish it.\nA beat. They eye each other warily. Colonel Fitzwilliam joins them.\nFITZWILLIAM: (indicating Darcy) What was my friend like, in Hertfordshire?\nLIZZIE: You really care to know?\nThe colonel nods.\nLIZZIE: (cont'd) Prepare yourself for something very dreadful. (stops playing) The first time\nI saw him, at the Assembly, he danced with nobody at all - even though gentlemen were\nscarce and there was more than one young lady who was sitting down without a partner.\nDARCY: (colouring) I knew nobody beyond my own party.\nLIZZIE: (smiles sweetly) True, aMRS.nd nobody can be introduced in a ballroom.\nLADY CATHERINE: Fitzwilliam! I need you!\nFitzwilliam moves away. Darcy and Lizzie are alone. Darcy's struggling with his pride which\nsuddenly gives way.\nDARCY: I do not have the talent of conversing easily with people I have never met before.\nLIZZIE: Perhaps you should take your aunt's advice and practice.\nDarcy flinches. Lizzie turns away from him and carries on playing. Darcy gazes at the curve\nof her neck.\n 77 INT. DRAWING ROOM - HUNSFORD - DAY.\nLizzie is writing a letter in the drawing room. She starts \"Dear Jane...\" The doorbell rings in\nthe background, she thinks nothing of it and continues. The maid opens the door to the\ndrawing room and Mr Darcy enters.\nLIZZIE: (astonished) Mr Darcy!\nAn awkward pause.\nLIZZIE: (cont'd) Please, do be seated. (pause) I'm afraid Mr and Mrs Collins are gone on\nbusiness to the village.\nA pause. What on earth does Mr Darcy want? He paces up and down.\nDARCY: This is a charming house. I believe my aunt did a great deal to it when Mr Collins\nfirst arrived.\nLIZZIE: I believe so - and she could not have bestowed her kindness on a more grateful\nsubject.\nAnother pause. [These two lines have been cut and Darcy doesn't sit down]\nDARCY: Mr Collins seems very fortunate in his choice of wife.\nLIZZIE: He is indeed lucky to have found one of the few sensible women who would have\naccepted him.\nDarcy sits down.\nLIZZIE (cont'd) Shall I call for some tea?\nDARCY: No. Thank you.\nThe sound of the front door, and voices. Darcy jumps up.\nDARCY: (cont'd) Good day, Miss Bennet. It's been a pleasure.\nHe bows to her and leaves. Lizzie sits there, bemused and intrigued.\nCUT TO: Charlotte, in the hallway, taking off her bonnet. Darcy hurries past her, with a\nswift bow, and leaves abruptly. Charlotte gazes after him in surprise. Charlotte heads to the\ndrawing room where she finds Lizzie still sitting thinking.\nCHARLOTTE: What on earth have you done to poor Mr Darcy?\nLIZZIE: I have no idea.\nTruly, she doesn't.\n78 INT. HUNSFORD CHURCH - DAY.\nMr Collins, in his vestments, stands in the pulpit delivering his sermon. Lady Catherine sits\nin the front row with her miserable-looking daughter and DOWNTRODDEN GOVERNESS.\nLizzie sits a little way behind with Colonel Fitzwilliam. They talk in whispers.\n LIZZIE: How long do you plan to stay in Kent, Colonel?\nFITZWILLIAM: As long as Darcy chooses. I am at his disposal.\nLIZZIE: Everyone appears to be at his disposal. I wonder he does not marry and secure a\nlasting convenience of that kind.\nFitzwilliam looks at Lizzie, curious about her brittle tone.\nFITZWILLIAM: She would be a lucky woman.\nLIZZIE: Really?\nFITZWILLIAM: Darcy is a most loyal companion. From what I heard, on our journey here,\nhe recently came to the rescue of one of his friends just in time.\nDarcy glances across from the adjacent pew.\nLIZZIE What happened?\nFITZWILLIAM: He saved the man from an imprudent marriage.\nLIZZIE: (faltering slightly) Who was the man?\nFITZWILLIAM: His closest friend. Charles Bingley.\nA silence.\nLIZZIE: Did Mr Darcy give you his reasons for this interference?\nFITZWILLIAM: There were apparently strong objections to the lady.\nLlZZlE: What kind of objections? Her lack of fortune?\nFlTZWlLLlAM: I think it was her family that was considered unsuitable.\nLlZZlE: So he separated them?\nFlTZWlLLlAM: 1 believe so. I know nothing else.\nLizzie grows pale. She turns to look at Darcy.\n79 EXT. ROSlNGS PARK - DAY.\nLizzie walks across the park - anywhere, she hardly cares. She is in a turmoil of misery and\nfury. lt starts to rain.\n                                    PRIDE AND PREJUDICE\n                             Screenplay by DEBORAH MOGGACH\n                             Based on the novel by Jane Austen\n                             SHOOTING SCRIPT 28th JUNE 2004\n80 EXT. SUMMER HOUSE - ROSlNGS PARK - DAY.\nA Grecian summer house by the lake. The rain is now bucketing down. Lizzie hurries into\nthe summer house and sits down, heavily, on a bench.\nA man approaches, across the park. He draws nearer. lt's Darcy. Lizzie stiffens. He's\nhurrying towards her. Sodden, breathless, he comes into the summer house. He is far too\nagitated to notice her upset face.\n DARCY: Miss Bennet, I have struggled in vain but I can bear it no longer... The past months\nhave been a torment...\nHe pauses, unable to speak. Lizzie stares at him in astonishment. He struggles on.\nDARCY: (cont'd) I came to Rosings with the single object of seeing you...l had to see you\nLlZZlE: Me?\nDARCY: l've fought against my better judgement, my family's expectation. . .\n(pause)\nDARCY: (cont'd) The inferiority of your birth. . .my rank and circumstance.. ( stumblingly)\nall those things.. .but I'm willing to put them aside.. .and ask you to end my agony...\nLIZZIE: I don't understand...\nDARCY: (with passion) I love you. Most ardently.\nLizzie stares at him.\nDARCY: (cont'd) Please do me the honour of accepting my hand.\nA silence. Lizzie struggles with the most painful confusion of feeling. Finally she recovers.\nLIZZIE: (voice shaking) Sir, I appreciate the struggle you have been through, and I am\nvery sorry to have caused you pain. Believe me, it was unconsciously done.\nA silence. Gathering her shawl, she gets to her feet. [In the movie she is already on her\nfeet]\nDARCY: (stares) Is this your reply?\nLIZZIE: Yes, sir.\nDARCY: Are you laughing at me?\nLIZZIE: No!\nDARCY: Are you rejecting me?\nLIZZIE: (pause) I'm sure that the feelings which, as you've told me, have hindered your\nregard, will help you in overcoming it.\nA terrible silence, as this sinks in. Neither of them can move. At last, Darcy speaks. He is\nvery pale.\nDARCY: Might I ask why, with so little endeavour at civility, I am thus repulsed?\nLIZZIE: (trembling with emotion) I might as well enquire why, with so evident a design of\ninsulting me, you chose to tell me that you liked me against your better judgement. If I\nwas uncivil, that was some excuse -\nDARCY: Believe me, I didn't mean\nLIZZIE: But I have other reasons, you know I have!\nDARCY: What reasons?\nLIZZIE: Do you think that anything might tempt me to accept the man who has ruined,\nperhaps for ever, the happiness of a most beloved sister?\nSilence. Darcy looks as if he's been struck across the face.\nLIZZIE: (cont'd) Do you deny it, Mr Darcy? That you've separated a young couple who\nloved each other, exposing your friend to the censure of the world for caprice, and my\n sister to its derision for disappointed hopes, and involving them both in misery of the\nacutest kind?\nDARCY: I do not deny it.\nLIZZIE: (blurts out) How could you do it?\nDARCY: Because I believed your sister indifferent to him.\nLIZZIE Indifferent?\nDARCY: I watched them most carefully, and realized his attachment was much deeper than\nhers.\nLIZZIE: That's because she's shy!\nDARCY: Bingley too is modest, and was persuaded that she didn't feel strongly for him.\nLIZZIE: Because you suggested it!\nDARCY: I did it for his own good.\nLIZZIE: My sister hardly shows her true feelings to me! (pause, takes a breath) I suppose\nyou suspect that his fortune had same bearing on the matter?\nDARCY: ( sharply) No! I wouldn't do your sister the dishonour. Though it was suggested\n(stops)\nLIZZIE: What was?\nDARCY: It was made perfectly clear that.. .an advantageous marriage. . . (stops)\nLIZZIE: Did my sister give that impression?\nDARCY: No!\nAn awkward pause.\nDARCY: (cont'd) There was, however, I have to admit... the matter of your family.\nLIZZIE: Our want of connection? Mr Bingley didn't vex himself about that!\nDARCY: No, it was more than that.\nLIZZIE: How, sir?\nDARCY: (pause, very uncomfortable) It pains me to say this, but it was the lack of\npropriety shown by your mother, your three younger sisters - even, on occasion, your\nfather. Forgive me.\nLizzie blushes. He has hit home. Darcy paces up and down.\nDARCY: (cont'd) You and your sister - I must exclude from this...\nDarcy stops. He is in turmoil. Lizzie glares at him, ablaze.\nLIZZIE: (icy) And what about Mr Wickham?\nDARCY: Mr Wickham?\nLIZZIE: What excuse can you give for your behaviour to him?\nDARCY: You take an eager interest in that gentleman's concerns!\nLIZZIE: He told me of his misfortunes.\nDARCY: Oh yes, his misfortunes have been very great indeed!\nLIZZIE: You have ruined his chances, and yet treat him with sarcasm?\nDARCY: So this is your opinion of me! Thank you for explaining so fully. Perhaps these\noffences might have been overlooked, if your pride had not been hurt -\nLIZZIE: My pride?\nDARCY: - by my honesty in admitting scruples about our relationship. Could you expect me\nto rejoice in the inferiority of your circumstances?\nLIZZIE: And those are the words of a gentleman? From the first moment I met you, your\narrogance and conceit, your selfish disdain of the feelings of others, made me realize that\nyou were the last man in the world I could ever be prevailed upon to marry.\nDarcy recoils, as if slapped. A terrible silence.\nDARCY: Forgive me, madam, for taking up so much of your time.\n He leaves, abruptly.\nLizzie watches him stride away, through the rain. What has she done?\n[no mentioning of Darcy approaching her and almost kissing her in the script]\n81 INT. HUNSFORD - DAY. [This scene has been cut]\nLizzie comes in soaked to the skin. Charlotte runs to her.\nCHARLOTTE: Lizzie!\nLIZZIE: I was caught off-guard.\nShe starts to laugh. There's a hysterical note to it and Charlotte bustles her away in some\nalarm.\n82 INT. BEDROOM - HUNSFORD - THE SAME. [This scene has been cut til Charlotte\nleaves]\nCharlotte attends to Lizzie who has changed and is drying her hair, a shawl around her\nshoulders.\nCHARLOTTE Shall I call the doctor?\nLIZZIE: No! Charlotte, I shall be quite all right. Please, give Lady de Bourgh my apologies.\nYou must not keep her waiting.\nMr Collins clatters up the stairs.\nMR COLLINS: (popping his head around the door) Come on. We shall be late!\nCharlotte leaves, reluctantly and goes downstairs. CUT TO: Lizzie walks down the upstairs\ncorridor.\n83 INT. DRAWING ROOM - HUNSFORD - DAY - NIGHT. [In the movie Darcy (V.O.)\nrelates the dealings with Wickham a little differently]\nLizzie is in the drawing room, she looks at a book on the table. It is Fordyce's Sermons.\nShe puts it down and walks to the mirror and stares at herself. The daylight moves and\nfades as seamlessly the scene turns to night. Lizzie puts her face into her hands and rubs it\nwearily. When she looks up Darcy is reflected behind her. They stare at each other without\nspeaking. Finally...\nDARCY: I came to leave you this.\nHe places a letter on the table behind her. Lizzie does not turn but watches him through the\nmirror.\nDARCY: (cont'd) I shall not renew the sentiments which were so disgusting to you, but if I\nmay, I will address the two offences you have laid against me.\nLizzie cannot bring herself to look at Darcy. She stares at the little imperfections on the\nsurface of the mirror.\n DARCY: (cont'd) My father provided for Mr Wickham a valuable living.\nAs Lizzie turns she realizes Darcy has gone. Darcy's voice carries.\nDARCY: (V.O.) (cont'd) But upon his death, however, Mr Wickham told me that he had no\nintention of taking orders and would I recompense him to the tune of 3000 pounds so he\ncould go to town and study the law.\nLizzie tears open the envelope, her hands shaking, and reads the letter, as Darcy's voice\ncarries on.\nDARCY: (V.O.) (cont'd) This I did, though by now I had some doubts about his character.\nThese were confirmed by reports that he had sunk into a life of idleness, gambling and\ndissipation. The money was soon used up, whereupon he wrote demanding more money\nwhich I refused, after which he severed all acquaintance -\nHolding the letter she looks out of the window to see Darcy riding away.\nDARCY: (V.O.) (cont'd) But last summer he unwillingly obtruded on my notice when he\nconnived a relationship with my sister whom he attempted to persuade to elope with him.\nHis objective was her inheritance of thirty thousand pounds. She was fifteen.\n84 EXT. HUNSFORD WOODS - NIGHT.\nDarcy rides at recklessly through a thick wood.\nDARCY: (V.0.) As to the other matter, that of your sister and Mr Bingley. Though the\nmotives which governed me may to you appear insufficient, they were in the service of a\nfriend.\n85 INT. DRAWING ROOM - HUNSFORD - LATER - NIGHT.\nLizzie with the letter. Charlotte walks in. Lizzie is shaking.\nCHARLOTTE: Lizzie! Are you alright?\nLIZZIE: I hardly know.\n86 EXT. BACK GARDEN. LONGBOURN - DAY.\nLizzie arrives back at Longbourn. She climbs down from her carriage and looks at the house\nfrom across the moat. Lizzie walks around the front of the house, through a window she\nsees Jane sitting quietly alone at her needle work. She takes a deep breath and enters.\n87 INT. LONGBOURN HOUSE - DAY.\nMrs. Bennet, is taking Lizzie's coat from her.\nMRS BENNET: How fortunate you have arrived, your aunt and uncle are here to deliver\nJane from London.\nLIZZIE: How is Jane?\nMRS BENNET: She's in the drawing room.\n Lizzie enters the drawing room.\n88 INT. DRAWING ROOM - LONGBOURN - DAY.\nLizzie and Jane sit together. Jane is all smiles, but behind her eyes is a sadness unseen\nbefore. Lizzie is equally unable to unburden herself.\nJANE: I am quite over him, Lizzie. If he passed in the street I would hardly notice. London\nis so diverting.\nLIZZIE: Oh Jane?\nJANE: It's true. So much to entertain. What news from Kent?\nLizzie: Nothing. At least, not much to entertain.\nLizzie tries to smile. There is a crash as the younger sisters enter the house. Kitty rushes\ninto the drawing room crying her eyes out, she is followed by Lydia and Mrs. Bennet.\nKITTY: Lizzie, tell mama, tell her!\nLYDIA: (smugly) Mrs. Forster has invited me.\nKITTY: (wails) Why didn't she ask me as well?\nLIZZIE: Kitty, what's happened?\nLYDIA: - because I'm better company.\nKITTY: I've just as much right as Lydia\nMRS BENNET: Oh, if I could but go to Brighton\nKITTY: - and more so, because I'm two years older!\nLizzie looks to Jane.\nJANE: Lydia has been invited to Brighton with the Foresters.\nMRS BENNET: A little sea-bathing would set me up very nicely.\nLYDIA: I shall dine with the officers every night!\nAn anguished wail from Kitty.\nMRS BENNET: I cried for two days when Colonel Miliar's regiment went away. I thought I\nshould have broke my heart.\nLIZZIE: Mother! Are you all mad?\nShe glares at them, deeply upset - by them, by everything.\n89 INT. LIBRARY - LONGBOURN - DAY.\nLizzie confronts her father.\nLIZZIE: Please Papa, don't let her go!\nMR BENNET: Lydia will never be easy till she has exposed herself in some public place or\nother, and we can never expect her to do it with so little inconvenience as under the\npresent circumstances.\nLIZZIE: (with great emotion) If you, dear father, will not take the trouble to check her, she\nwill be fixed forever as the silliest and most determined flirt who ever made her family\nridiculous. And Kitty will follow, as she always does.\nMR BENNET: We shall have no peace until she goes.\nLIZZIE: (really angry now) Peace! Is that all you care about?\nMR BENNET: Colonel Forster is a sensible man and will keep her out of any real mischief,\n and she is far too poor to be an object of prey to anyone.\nLIZZIE: Father, it's dangerous!\nMR BENNET: I'm sure the officers will find women better worth their while. Let us hope, in\nfact, that her stay in Brighton will teach her her own insignificance. At any rate she can\nhardly grow any worse, without authorizing us to lock her up for the rest of her life.\nLizzie gazes at her father - will nothing touch him? He gave up on Lydia long ago. For this,\njust now, she hates him.\nLIZZIE: No wonder our family is treated with contempt.\nShe leaves, tears stinging her eyes. Her father looks puzzled at her outburst.\n90 INT.- KITCHEN - LONGBOURN - NIGHT.\nLizzie is preparing a late supper for MR AND MRS GARDINER, her aunt and uncle. Mrs.\nGardiner is a kindly woman and Mr. Gardiner talks with a London accent. Mary is also\nhelping.\nMRS GARDINER: Lizzie dear, you would be very welcome to accompany us?\nMR GARDINER: Oh yes. We plan to journey through the Peak .District. You'd be most\nwelcome.\nMARY: Oh, the glories of nature! What are men, compared to rocks and mountains?\nLIZZIE: Believe me, men are either eaten up with arrogance or stupidity. And if they are\namiable they're so easily led that they have no minds of their own whatsoever.\nMRS GARDINER: Take care, my love, that savors strongly of bitterness.\nLizzie looks at her, surprised at the sting of truth.\n91 INT. BEDROOM - LONGBOURN - NIGHT.\nLizzie and Jane lie next to each other in the darkness ._\nPause.\nLIZZIE: I saw Mr. Darcy when I was in Rosings.\nJANE: Why did you not tell me? Did he mention Mr. Bingley?\nLIZZIE No. He did not.\n92 INT. CARRIAGE - DERBYSHIRE - DAY.\nSunlight flickers through the trees lining the road. Lizzie has her eyes shut and feels the\nwind on her face. She opens her eyes...\n93 EXT. DERBYSHIRE - DAY. [scene in movie without the Gardiners. Lizzie alone\non top of the peak]\n   A ravishing landscape of savage and romantic beauty scudding clouds, mountains, wild\n   rocky outcrops. Lizzie is walking freely, the wind in her hair. As she nears the peak of a\n promontory, Mr. and Mrs. Gardiner are below making their way towards her. They smile at\n her. She strides off determined to reach the very top. When she gets there she stands with\nher arms outstretched, her head back laughing into the wind. The view is -magnificent. She\n                                        breathes deeply.\n 94 [scene deleted]"
unlist(str_extract_all(pnp_text_line, pattern = " the ")) # 문자열 객체가 먼저 오고 정규표현식의 지정된 패턴이 뒤따릅니다. 
##   [1] " the " " the " " the " " the " " the " " the " " the " " the "
##   [9] " the " " the " " the " " the " " the " " the " " the " " the "
##  [17] " the " " the " " the " " the " " the " " the " " the " " the "
##  [25] " the " " the " " the " " the " " the " " the " " the " " the "
##  [33] " the " " the " " the " " the " " the " " the " " the " " the "
##  [41] " the " " the " " the " " the " " the " " the " " the " " the "
##  [49] " the " " the " " the " " the " " the " " the " " the " " the "
##  [57] " the " " the " " the " " the " " the " " the " " the " " the "
##  [65] " the " " the " " the " " the " " the " " the " " the " " the "
##  [73] " the " " the " " the " " the " " the " " the " " the " " the "
##  [81] " the " " the " " the " " the " " the " " the " " the " " the "
##  [89] " the " " the " " the " " the " " the " " the " " the " " the "
##  [97] " the " " the " " the " " the " " the " " the " " the " " the "
## [105] " the " " the " " the " " the " " the " " the " " the " " the "
## [113] " the " " the " " the " " the " " the " " the " " the " " the "
## [121] " the " " the " " the " " the " " the " " the " " the " " the "
## [129] " the " " the " " the " " the " " the " " the " " the " " the "
## [137] " the " " the " " the " " the " " the " " the " " the " " the "
## [145] " the " " the " " the " " the " " the " " the " " the " " the "
## [153] " the " " the " " the " " the " " the " " the " " the " " the "
## [161] " the " " the " " the " " the " " the " " the " " the " " the "
## [169] " the " " the " " the " " the " " the " " the " " the " " the "
## [177] " the " " the " " the " " the " " the " " the " " the " " the "
## [185] " the " " the " " the " " the " " the " " the " " the " " the "
## [193] " the " " the " " the " " the " " the " " the " " the " " the "
## [201] " the " " the " " the " " the " " the " " the " " the " " the "
## [209] " the " " the " " the " " the " " the " " the " " the " " the "
## [217] " the " " the " " the " " the " " the " " the " " the " " the "
## [225] " the " " the " " the " " the " " the " " the " " the " " the "
## [233] " the " " the " " the " " the " " the " " the " " the " " the "
## [241] " the " " the " " the " " the " " the " " the " " the " " the "
## [249] " the " " the " " the " " the " " the " " the " " the " " the "
## [257] " the " " the " " the " " the " " the " " the " " the " " the "
## [265] " the " " the " " the " " the " " the " " the " " the " " the "
## [273] " the " " the " " the " " the " " the " " the " " the " " the "
## [281] " the " " the " " the " " the " " the " " the " " the " " the "
## [289] " the " " the " " the " " the " " the " " the " " the " " the "
## [297] " the " " the " " the " " the " " the " " the " " the " " the "
## [305] " the " " the " " the " " the " " the " " the " " the " " the "
## [313] " the " " the " " the " " the " " the " " the " " the " " the "
## [321] " the " " the " " the " " the " " the " " the " " the " " the "
## [329] " the " " the " " the " " the " " the " " the " " the " " the "
## [337] " the " " the " " the " " the " " the " " the " " the " " the "
## [345] " the " " the " " the " " the " " the " " the " " the " " the "
## [353] " the " " the " " the " " the " " the " " the " " the " " the "
## [361] " the " " the " " the " " the " " the " " the " " the " " the "
## [369] " the " " the " " the " " the " " the " " the " " the " " the "
## [377] " the " " the " " the " " the " " the " " the " " the " " the "
## [385] " the " " the " " the " " the " " the " " the " " the " " the "
## [393] " the " " the " " the " " the " " the " " the " " the " " the "
## [401] " the " " the " " the " " the " " the " " the " " the " " the "
## [409] " the " " the " " the " " the " " the " " the " " the " " the "
## [417] " the " " the " " the " " the " " the " " the " " the " " the "
## [425] " the " " the " " the " " the " " the " " the " " the " " the "
## [433] " the " " the " " the " " the " " the " " the " " the " " the "
## [441] " the " " the " " the " " the " " the " " the " " the " " the "
## [449] " the " " the " " the " " the " " the " " the " " the " " the "
## [457] " the " " the " " the " " the " " the " " the " " the " " the "
## [465] " the " " the "
# pattern 즉 정규표현 구성을 지정하는 옵션값 설정

이처럼 간단해 보일지 모르지만 강조해야할 몇 가지 세부 사항이 있습니다. 첫 번째는 정규표현식 검색이 대소 문자를 구분한다는 것입니다. 이 말은 곧, " THe “라는 표현은 pnp_text_line에서 어떤 패턴과도 매칭되지 않는다는 것을 의미합니다..

unlist(str_extract_all(pnp_text_line, " THe ")) # 정규표현식은 대소 문자를 구별하므로 "THe"와는 아무 것도 일치하지 않습니다.
## character(0)

숫자는 어떨까요? 다행히 모든 숫자(문자도 마찬가지입니다)는 리터럴 문자로 간주됩니다. 패턴 “2004”을 테스트 해봅시다.

str_extract_all(pnp_text[1], "2004") # 모든 숫자는 리터럴 문자입니다.
## [[1]]
## [1] "2004" "2004"

메타 문자

이제 우리는 메타문자(metacharacter)에 대해서 학습할 것입니다. 가장 기본적인 유형의 정규 표현식은 자신과 일치하는 리터럴 문자입니다. 하지만 모든 문자가 리터럴 문자는 아닙니다. 정규 표현을 구성하는 데 있어서 특수 목적을 갖고 그 역할을 수행하는 문자들도 있습니다. 그것이 바로 메타문자입니다. 이런 유형의 문자는 특별한 의미가 있기 때문에 일괄적으로 리터럴 문자들을 찾아내는 데 유용합니다.

정규표현식에서 metacharacters에는 15개의 종류가 있습니다. 각 기능에 대해서는 앞으로 적용해가면서 배워봅시다.

앞으로 우리는 이러한 메타 문자를 응용하여 정규 표현을 구성하는 법을 알아 볼 것입니다. 사실, 정규 표현식에서 중요한 것은 이 메타 문자가 어떻게 작동하는지 이해하고 적용하는 것입니다. 다행히, 메타 문자의 종류가 아주 많지는 않죠. 하지만 몇몇 메타 문자에는 하나 이상의 의미를 가진 것도 있습니다. 그리고 이 경우 메타 문자의 의미는 사용하는 맥락, 사용 방법, 사용 장소에 따라 달라지게 되죠. 마치 우리가 일상적으로하는 대화에서도 같은 어휘라도, 문맥에 따라 그 의미가 완전히 달라지게 되는 경우가 있는 것 처럼 말이죠. 따라서 이러한 정규 표현의 메타 문자를 이해하고 응용에 익숙해지는 데에는 시간이 다소 걸릴 수 있으며 많은 연습이 필요합니다.

와일드 메타 문자

우리가 배울 첫 메타 문자는 wild 메타 문자로 더 잘 알려진 “.”(점)입니다. 이 메타 문자는 모든 리터럴 문자를 찾는데 (매칭하는데) 사용됩니다.

예를 들어, "t.e"로 구성된 regex를 생각해봅시다. 이 표현은 “the”라는 패턴 뿐만 아니라, “tae”, “tee”, “tie”, “toe” 등 과도 매칭됩니다. 그러나 하나의 점은 하나의 단일 문자와만 일치하므로 “thee”, “tree”, 또는 “tube”와는 매칭되지 않습니다.

위키피디아 페이지의 텍스트를 단어 단위로 토큰화한 결과가 벡터로 할당된 pnp_sent_trim 객체에 이 정규표현을 적용해 보겠습니다.

unique(unlist(str_extract_all(pnp_text_line, "t.e")))
##  [1] "tle" "the" "tte" "twe" "toe" "t e" "tie" "tne" "tee" "tre" "tue"
## [12] "tme"
unique(unlist(str_extract_all(pnp_text_line, "t.e ")))
## [1] "the " "tle " "tte "
unique(unlist(str_extract_all(pnp_text_line, " t.e")))
## [1] " the" " twe" " toe" " tee" " tre"

와일드 메타 문자는 정규 표현식에서 가장 많이 사용되는 메타 문자 중 하나이지만 많은 실수의 이유가 되기도 합니다. 예를 들어, "e.g"와 일치하는 정규 표현식을 만들고 싶다고 가정해봅시다. 이 패턴은 “e.g”뿐만 아니라, “eng”, “e g”, “e-g”와도 일치할 수 있습니다.

왜?

왜냐하면 "."은 모든 것과 일치하는 메타 문자이기 때문입니다.

메타 문자 이스케이프

그렇다면 메타 문자 대신 리터럴 문자로서의 마침표를 찾아내고 매칭시킬 수 있을까요? 예를 들어, 다음과 같은 문자열 벡터가 있다고 가정해 봅시다.

dot_words <- c("e.g", "eng", "e g", "e-g")

패턴 "e.g"를 사용하면, dot_words에 있는 모든 요소와 일치합니다.

unlist(str_extract_all(dot_words, "e.g"))
## [1] "e.g" "eng" "e g" "e-g"

따라서 리터럴 문자인 마침표와 매칭시키려면, 메타 문자를 이스케이프 처리해야 합니다.

대부분의 프로그래밍 언어에서 메타 문자를 이스케이프하는 방법은 메타 문자 앞에 백 슬래시 문자를 추가하는 것입니다. 메타 문자 앞에 백 슬래시를 붙이면 메타문자로서의 더 이상 특별한 의미를 가지지 않으며 리터럴 문자로서 인식하게 됩니다. 그러나 R은 조금 다릅니다. 단일 백슬래시를 넣는 것이 아니라 2개의 백 슬래시를 넣어야 합니다. : "e\\.g". 단일 백 슬래시 "\"가 R에서는 메타 문자로 다른 의미를 가지기 때문입니다.

unlist(str_extract_all(dot_words, "e\\.g"))
## [1] "e.g"

퀴즈

위키피디아 텍스트의 문자열 벡터 객체인 pnp_text_line에서 리터럴 문자,“a”,로 시작되는 세 글자 요소들을 모두 찾아내어 추출한 후, 각 요소의 등장 빈도수를 보여주는 명령어는 다음 중 무엇입니까?

  1. table(unlist(str_extract_all(pnp_text_line, "a..")))
  2. table(unlist(str_extract_all(pnp_text_line, "a ")))
  3. table(str_extract_all(pnp_text_line, "a.."))
  4. table(unlist(str_extract_all(pnp_text_line, "a\\.\\.")))
  5. table(str_extract_all(pnp_text_line, "a\\.\\."))

정규 표현식 연습

지금까지 메타 문자를 이스케이프 (탈출)하여 리터럴 문자로서 매칭하는 방법에 대해 학습하였습니다. 이제부터는 문자 집합을 정의하는데에 사용되는 메타 문자인 대괄호 []에 대해 알아보도록 하겠습니다.

가령, 우리가 “t”로 시작되어 “e”로 끝나는 세글자 단어 모두를 찾아내서 지워주고 싶다고 가정해 봅시다. 이 경우 우리는 중간에 올 수 있는 모든 알파벳 경우를 가정해서 단어 집합으로 구성된 정규 표현을 이용해 줄 수 있습니다. 하지만, 그러나 이러한 방식으로 우리가 원하는 모든 문자를 매칭하는 것은 매우 소모적인 일일 것입니다. 이 경우에 우리는 문자 그 자체와 일치하지는 않지만 원하는 문자들의 범위를 지정해주는 방법으로 패턴을 매칭하는 방법을 택할 수 있습니다.

문자 집합

문자 집합은 집합 안에 있는 다양한 문자 중 하나와 일치합니다. 즉, "[abc]"라는 표현은 문자 “a”, “b”, “c” 중 어떤 것과도 매칭됩니다. 여기서 대괄호 []는 문자 집합을 정의하는 표현입니다.

문자 집합 내의 문자 순서는 중요하지 않습니다. 중요한 것은 대괄호 안에 있는 문자의 종류입니다. 따라서 문자 집합 "[abc]""[cba]"와 같은 기능을 합니다.

문자 집합의 적용

"f[aeiou]n"라는 정규 표현 패턴으로 “fan”, “fin”, “fun”라는 단어 등이 속해있는 문자열 벡터에 매칭해봅시다.

library(stringr)
fns <- c("fan","fen","fin","fon","fun")
unlist(str_extract_all(fns, "f[aeiou]n")) #알파벳 모음 집합
## [1] "fan" "fen" "fin" "fon" "fun"

“f[aeiou]n” 집합은 fns의 모든 요소와 일치합니다. 이제 같은 문자 집합 패턴을 다른 벡터 fnx에 적용해 봅시다.

fnx <- c("fan","fin","fun","f0n","f.n","f1n","fain")
unlist(str_extract_all(fnx, "f[aeiou]n"))
## [1] "fan" "fin" "fun"

보다시피 fnx 안에 모음 문자가 있는 처음 세 요소만 일치합니다. 그리고 마지막 요소 “fain”은 일치하지 않습니다. 문자 집합은 하나의 문자로서 “a” 또는 “i” 에만 일치하고 “ai”는 매칭하지 않습니다.

문자 범위

위에서 설명한 문자 집합은 찾고자 하는 문자 모두를 지정합니다. 그렇다면 알파벳(대문자 또는 소문자)의 범위 또는 임의의 숫자 범위에 속하는 어떤 문자와도 매칭되는 문자 집합은 어떻게 구성할 수 있을까요?

메타 문자 하이픈을(hyphen) "-" 사용해서 문자 범위를 구성하면 이 문제를 해결할 수 있습니다. 즉, 매칭하고자 하는 문자들의 범위를 하이픈 "-" 기호로 지정하는 것입니다.

이러한 방식으로 다음과 같이 대문자, 소문자, 그리고 숫자 문자 집합을 정의할 수 있습니다.

uppercase <- "[A-Z]"

lowercase <- "[a-z]"

number <- "[0-9]"

*하이픈 기호는 문자 집합 안에 있을 때만 메타 문자입니다. 문자 집합 이외에서 쓰이는 하이픈은 리터럴 문자입니다.

이렇게 문자 범위로 구성된 정규 표현은 매우 유용합니다. 다음의 예를 함께 보실까요.

3개의 문자로 구성된 문자열을 가진 다음의 벡터 객체, triplets,를 상대로 문자 범위로 구성된 정규표현으로 매칭한 결과를 살펴봅시다.

triplets <- c("abc","the","ABC","The","010","070",":~)","^^;")
unlist(str_extract_all(triplets, "[a-z][a-z][a-z]")) # 3개의 연속된 소문자 
## [1] "abc" "the"
unlist(str_extract_all(triplets, "[A-Z]{3}")) # 3개의 연속된 대문자 
## [1] "ABC"
unlist(str_extract_all(triplets, "[A-Z][a-z]+")) # 대문자를 먼저 쓰고 그 다음 소문자 1회 이상 
## [1] "The"
unlist(str_extract_all(triplets, "[0-9]+$")) # 연속된 숫자 1회 이상이고 숫자로 종결
## [1] "010" "070"

이렇게 문자 범위로 구성된 문자 집합을 이용하면 편리하게 텍스트 패턴을 매칭할 수 있습니다. 하지만, 위의 문자 범위로는 구두점으로 구성된 웃음 표시 ":~)""^^;"를 매칭할 수는 없었네요.

부정 문자 집합

정규 표현식으로 텍스트를 처리할 때, 특정 문자 집합에서 벗어나는 즉, 문자 집합의 일부가 아닌 문자를 찾아내야 하는 상황은 빈번하게 발생합니다. 위키피디아 페이지의 전처리를 예를 들어 볼까요. 이 때 우리는 알파벳 이외의 문자 즉, 한글 또는 한자로 표시된 문자를 매칭해서 지워줘야 할 필요가 있었습니다. 이때 우리는 부정 문자 집합을 사용하여 우리가 원하는 문자 집합에 없는 문자를 찾아낼 수 있습니다. 이 부정 집합은 위해 메타 문자 캐럿 "^"으로 구성할 수 있습니다.

캐럿 "^"은 정규 표현식의 패턴에 하나 이상의 의미를 가지는 메타 문자 중 하나입니다. 그 중, 문자 집합 안의 첫번째 위치에 캐럿을 사용하면 : 예 : "[^a-z]", 다음의 문자 이외의 문자 즉, 부정 기능을 수행합니다. 따라서 알파벳 소문자를 제외한 모든 문자를 매칭합니다.

이렇게 부정 문자 범위를 사용하면 우리는 다음과 같은 "[^a-zA-Z0-9][^a-zA-Z0-9][^a-zA-Z0-9]" 패턴을 정의함으로써 문자와 숫자가 아닌 기호로 표시된 문자열인 웃음 표시 ":~)""^^;"를 매칭할 수 있습니다.

unlist(str_extract_all(triplets, "[^a-zA-Z0-9]{1,}")) # 문자 및 숫자 이외의 문자가 1회 이상 매칭되는 모든 요소
## [1] ":~)" "^^;"

캐럿은 문자 집합 안에 처음으로 오는 경우에만 부정을 의미하며, 그렇지 않으면 부정 문자 집합이 아닙니다. 가령,

unlist(str_extract_all(triplets, "[a-zA-Z0-9^]+")) # 문자/숫자/캐럿 1회 이상 연결되는 문자열 매칭
## [1] "abc" "the" "ABC" "The" "010" "070" "^^"

이 경우, 패턴 "[a-zA-Z0-9^]"은 부정 집합 "[^a-zA-Z0-9]"과 완전히 다른 “문자 또는 숫자 또는 리터럴 캐럿 문자”를 의미합니다.

문자 집합 안의 메타 문자

지금까지 문자 집합이 무엇인지, 그리고 문자 범위를 정의하는 방법과 부정 문자 집합을 지정하는 방법에 대해 알아보았습니다. 이제 문자 집합 안에 메타 문자를 포함시킬 때 어떤 일이 일어나는지 보겠습니다.

문자 집합을 사용할 경우 첫 번째 위치에 있는 캐럿, 그리고 문자 범위를 지정하는 하이픈, 그리고 문자 집합 기호인 대괄호를 제외하고는, 문자 집합 내의 메타 문자는 리터럴 문자로서 기능합니다! 즉, 문자 집합 안에서는 이중 백 슬래시를 사용하여 이스케이프 처리할 필요가 없습니다.

예를 들어, fnx 문자열 벡터에서 “f” 와 “n” 사이에 위치하는 다양한 문자는 리터럴 문자인 마침표도 포함하죠. 이 때 우리가 “f.n”이라는 문자열을 매칭하기 위해서 구성할 수 있는 정규 표현은 메타문자를 이스케이프하거나 문자집합을 사용하는 것입니다.

unlist(str_extract_all(fnx, "f\\.n")) 
## [1] "f.n"
unlist(str_extract_all(fnx, "f[.]n")) 
## [1] "f.n"

문자 클래스

문자 범위 이외에도 문자 클래스는 특정 문자 집단을 매칭하는데 유용한 정규 표현 구조를 제공합니다. 그리고 문자 클래스의 구성은 이중 백슬래시와 이니셜 문자로 시작합니다. 대부분의 정규 표현식 엔진에서 사용되는 가장 일반적인 문자 클래스는 다음과 같습니다.

문자 일치 같은 표현
\\d 임의의 숫자 [0-9]
\\D 임의의 숫자 이외의 문자 [^0-9]
\\w 밑줄 문자 “_“를 포함하여 영어 단어의 일부로 간주되는 문자 [a-zA-Z0-9_]
\\W 영어 단어의 일부로 간주되지 않는 문자 [^a-zA-Z0-9_]
\\s 공백 문자 [\f\n\r\t\v]
\\S 비공백 문자 [^\f\n\r\t\v]

문자 클래스는 문자 집합을 쉽게 매치하는 메타 문자로 사용할 수 있습니다.

unlist(str_extract_all(triplets, "\\d{3}")) # 3개의 임의의 숫자 연결된 패턴
## [1] "010" "070"
unlist(str_extract_all(triplets, "\\D+")) # 1개 이상 연속된 비 숫자 패턴
## [1] "abc" "the" "ABC" "The" ":~)" "^^;"
unlist(str_extract_all(triplets, "\\w+")) # 1개 이상 연속된 문자/숫자
## [1] "abc" "the" "ABC" "The" "010" "070"
unlist(str_extract_all(triplets, "\\W+")) # 1개 이상 연속된 문자/숫자
## [1] ":~)" "^^;"
unlist(str_extract_all(triplets, "\\s+")) # 1개 이상 연속된 공백
## character(0)
unlist(str_extract_all(triplets, "\\S+")) # 1개 이상 연속된 비공백 문자
## [1] "abc" "the" "ABC" "The" "010" "070" ":~)" "^^;"

텍스트 사전처리를 하다 보면 텍스트 공백이 다양한 방식의 문자 표현으로 구성되어 있다는 것을 발견하게 될 것입니다. 다음은 공백을 나타내는 문자를 보여주는 표입니다. :

문자 정의
\f 페이지 넘김
\n 줄바꿈
\r 캐리지 리턴
\t
\v 수직 탭

때로는 텍스트에 인쇄되지 않는 공백 문자가 포함됩니다. (\t, \n, \r\n) 그렇기 때문에 모든 공백 문자 유형을 일치시키기 위해 공백 문자 클래스 \\s를 사용해야합니다.

Mac OS는 \n을 사용하는 반면에, Window는 \r\n을 줄 끝 표시로 사용하는 운영체제입니다.

  • 페이지 넘김 \f는 다음 ‘페이지’ 또는 ’섹션’을 구분 기호로 사용하여 아래쪽으로 가는 것을 의미합니다.
  • 캐리지 리턴 \r은 줄의 처음으로 돌아가는 것입니다.

POSIX (Portable Operating System Interface) 문자 클래스

정규 표현식을 구성 방법을 마무리하기 위해 POSIX로 알려진 또 다른 유형의 문자 클래스를 소개합니다. 다음은 R에서 정규표현식 엔진이 지원하는 POSIX 문자 클래스 구조입니다. :

문자 일치 같은 구조
[[:alnum:]] 영숫자 [a-zA-Z0-9]
[[:alpha:]] 알파벳 문자 [a-zA-Z]
[[:digit:]] 숫자 [0-9]
[[:lower:]] 소문자 [a-z]
[[:upper:]] 대문자 [A-Z]
[[:word:]] 단어 (문자, 숫자, 언더스코어) [a-zA-Z0-9_]
[[:blank:]] 공백과 탭 [ \t]
[[:space:]] 모든 공백 문자(줄 바꿈 포함) [ \f\n\r\t\v]
[[:punct:]] 구두점과 기호
[[:graph:]] 공백을 제외한 모든 인쇄 가능한 문자 [:alnum:][:punct:]
[[:print:]] 인쇄 가능한 모든 문자 [:alnum:][:punct:][:space:]
[[:ascii:]] 모든 ASCII 문자 (알파벳)

POSIX 문자 클래스는 여는 대괄호 [, 뒤에 콜론 :, 키워드 뒤에 이어 콜론 :, 닫는 대괄호 ]로 구성됩니다.

R에서 사용하려면 문자 집합 안에 POSIX 클래스를 래핑해야 합니다. 즉, POSIX 클래스를 다른 쌍의 대괄호로 묶어야합니다. POSIX 클래스를 사용하여 triplets라는 문자 벡터의 요소를 매치시켜 봅시다.

triplets
## [1] "abc" "the" "ABC" "The" "010" "070" ":~)" "^^;"
unlist(str_extract_all(triplets, "[[:lower:]]+")) # 1개 이상의 연속된 문자
## [1] "abc" "the" "he"
unlist(str_extract_all(triplets, "[[:alpha:]]+"))
## [1] "abc" "the" "ABC" "The"
unlist(str_extract_all(triplets, "[[:digit:]]{1,3}")) # 1개 이상 3개 이하로 연속된 숫자
## [1] "010" "070"
unlist(str_extract_all(triplets, "[[:punct:]~^]+")) # [:punct:] 리터럴 문자 캐럿 "^" "~"을 매칭하지 않습니다.
## [1] ":~)" "^^;"
unlist(str_extract_all(triplets, "[[:lower:][:punct:]]")) # 모든 단일 소문자/구두점
##  [1] "a" "b" "c" "t" "h" "e" "h" "e" ":" ")" ";"

Regex를 이용하여 신(Scene)별로 텍스트 구분하기

pnp_text <- pdf_text("pnp_script.pdf")
pnp_text <- paste(pnp_text, collapse=" ")


pnp_text_line <- unlist(str_split(pnp_text, "\n"))

pnp_df <- data_frame(line = 1:length(pnp_text_line), 
                     text = pnp_text_line)

str_view_all(pnp_text, "[[:digit:]]?[[:upper:][:punct:][:blank:]]+[[:upper:]]+\\.")
pnp_text_scene <- str_split(pnp_text, "(INT|EXT|SCENE)[[:upper:][:punct:][:blank:]]+")
class(pnp_text_scene)
## [1] "list"
length(unlist(pnp_text_scene))
## [1] 94
pnp_df
## # A tibble: 1,539 x 2
##     line text                                                             
##    <int> <chr>                                                            
##  1     1 "                                     Pride and Prejudice"       
##  2     2 "                              Screenplay by Deborah Moggach"    
##  3     3 "                               Shooting script 28th June 2004"  
##  4     4 1 EXT. LONGBOURN HOUSE - DAY.                                    
##  5     5 FADE UP ON: A YOUNG WOMAN, as she walks through a field of tall,…
##  6     6 reading a novel entitled 'First Impressions'.                    
##  7     7 This is LIZZIE BENNET, 20, good humoured, attractive, and nobody…
##  8     8 Longbourn, a fairly run down 17th Century house with a small moa…
##  9     9 up onto a wall and crosses the moat by walking a wooden plank du…
## 10    10 learnt in early childhood. She walks passed the back of the hous…
## # ... with 1,529 more rows
### 신(Scene) 타이틀을 매칭하기 위한 regex 
which(str_detect(pnp_df$text, " ?(INT|EXT|SCENE)")) # which() 함수는 조건이 참인 요소의 위치 값을 반환
##  [1]    4   16   34   44   47   77   79  131  173  191  197  221  240  274
## [15]  276  277  278  282  289  291  303  306  329  335  349  360  374  380
## [29]  444  446  448  454  457  484  505  509  512  519  526  546  552  583
## [43]  601  610  629  646  676  712  717  731  757  773  787  796  855  870
## [57]  871  889  896  954  966  990 1001 1005 1008 1025 1033 1059 1076 1084
## [71] 1093 1117 1122 1124 1157 1194 1238 1267 1293 1300 1396 1402 1413 1442
## [85] 1447 1451 1455 1462 1489 1510 1522 1528 1531

이제 문자 “pnp_df$text”에 숫자로 시작되고 대문자 문자열 (INT) 또는 (EXT) 또는 (SCENE)이라는 문자열을 매칭하는 정규표현식이 몇번 째 요소에서 참으로 나타나는지 알 수 있고, 이를 기준으로 신(scene) 넘버링을 하는 변수를 만들 수 있습니다.

library(tidytext)

cumsum(c(TRUE, FALSE, FALSE, TRUE, FALSE, TRUE))
## [1] 1 1 1 2 2 3
pnp_df$scene <- cumsum(str_detect(pnp_df$text, "(INT|EXT|SCENE)[[:upper:][:punct:][:blank:]]+"))

pnp_df
## # A tibble: 1,539 x 3
##     line text                                                        scene
##    <int> <chr>                                                       <int>
##  1     1 "                                     Pride and Prejudice"      0
##  2     2 "                              Screenplay by Deborah Mogga…     0
##  3     3 "                               Shooting script 28th June …     0
##  4     4 1 EXT. LONGBOURN HOUSE - DAY.                                   1
##  5     5 FADE UP ON: A YOUNG WOMAN, as she walks through a field of…     1
##  6     6 reading a novel entitled 'First Impressions'.                   1
##  7     7 This is LIZZIE BENNET, 20, good humoured, attractive, and …     1
##  8     8 Longbourn, a fairly run down 17th Century house with a sma…     1
##  9     9 up onto a wall and crosses the moat by walking a wooden pl…     1
## 10    10 learnt in early childhood. She walks passed the back of th…     1
## # ... with 1,529 more rows
pnp_df[11:30,]
## # A tibble: 20 x 3
##     line text                                                        scene
##    <int> <chr>                                                       <int>
##  1    11 window to the library, we see her mother and father, MR an…     1
##  2    12 MRS BENNET: My dear Mr Bennet, have you heard that Netherf…     1
##  3    13 We follow Lizzie into the house, but still overhear her pa…     1
##  4    14 MRS BENNET: (cont'd) Do you not want to know who has taken…     1
##  5    15 wish to tell me, I doubt I have any choice in the matter.       1
##  6    16 2 INT. LONGBOURN - CONTINUOUS.                                  2
##  7    17 As Lizzie walks through the hallway, we hear the sound of …     2
##  8    18 the afternoon. She walks down the entrance hall past the r…     2
##  9    19 bluestocking of the family, is practising, and finds KITTY…     2
## 10    20 at the door to the library. Lizzie pokes Lydia.                 2
## 11    21 LIZZIE: Liddy! Kitty - what have I told you about listenin…     2
## 12    22 there's a Mr Bingley arrived from the North                     2
## 13    23 KITTY: - with more than one chaise                              2
## 14    24 LYDIA: - and five thousand a year!                              2
## 15    25 LIZZIE: Really?                                                 2
## 16    26 LYDIA: And he's single!                                         2
## 17    27 JANE, the eldest and very beautiful if rather naive sister…     2
## 18    28 JANE: Who's single?                                             2
## 19    29 LIZZIE: A Mr Bingley, apparently.                               2
## 20    30 KITTY: Shhhh!                                                   2
pnp_df %>% 
  unnest_tokens(word, text) %>% 
  group_by(scene) %>% 
  filter(!duplicated(word)) %>% 
  summarise(n = n()) %>% 
  ungroup() %>% 
  ggplot(aes(x=scene, y=n)) +
  geom_col()