niceql 0.1.20 → 0.1.21

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 321c779b1a04b51acd414e9187733f8b50a7ab3d
4
- data.tar.gz: 076c67bbf5825fc79df1c49fc99cf75c3e0a4a23
3
+ metadata.gz: 2efccbbe22d5da01e7efe8fca21ed008f78e4eb1
4
+ data.tar.gz: b4290f066aef1b5c18e1199e291c093ff22d26ba
5
5
  SHA512:
6
- metadata.gz: 8bf9b7cc77e345ea167f2e5bc72ca9628f880641d01cf99f3f18d97ef030f3be1e74112763523ec1699527be2513ad763e043c634c5528a13850e6bf15fec1d1
7
- data.tar.gz: 8921f764d6ce823ac4e08143ce45e6c3b1b039163b4adb14e6f809694f10e6e20c089fde455619d6db3c56fe6bcf59ee7e2c949ebf3685c8f4ed273926ce6500
6
+ metadata.gz: 88846a6a3a4efea29e1c1d71eec1a2400c1b3fdf51d61cb4dcc428dace318aa55ff725f51ab13f82ca86fb9c57204c664aee35e99abee21c9c0f47654a8790c6
7
+ data.tar.gz: 7806bad02c6f18dfa5efca5d5b290dbca3726f42213edff413b2e8032bd52b14bea8d1980bffd0703c8af156a83203184694ef9196e5fdbef67265a94bff7802
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 0.1.21
2
+ * fix bug for SQL started with comment
3
+
1
4
  # 0.1.20
2
5
  * Add respect for SQL comments single lined, multi lined, and inline
3
6
 
@@ -0,0 +1,80 @@
1
+ require 'benchmark/ips'
2
+
3
+ $str = File.open( './txt' ).readlines.join(' ')
4
+
5
+ def str_gen( size, rand_size )
6
+ $str[ rand(50000), size + rand(rand_size) ]
7
+ end
8
+
9
+ def chunk_gen( size )
10
+ $str[ rand(50000), size ]
11
+ end
12
+
13
+ # 2 + 1 = 3 object
14
+ def slow_plus(size, rand_size )
15
+ str_gen(size, rand_size ) + str_gen(size, rand_size )
16
+ end
17
+
18
+ # 2 + 1 = 3 object
19
+ def slow_concat(size, rand_size)
20
+ str_gen(size, rand_size ).concat str_gen(size, rand_size )
21
+ end
22
+
23
+ # 2 + 1 = 3 object
24
+ def slow_append(size, rand_size)
25
+ str_gen(size, rand_size ) << str_gen(size, rand_size )
26
+ end
27
+
28
+ def fast_interpolation(size, rand_size)
29
+ "#{str_gen(size, rand_size )}#{str_gen(size, rand_size )}"
30
+ end
31
+
32
+
33
+
34
+ def test_concat(size, rand_size, chunk_size = 1)
35
+ Benchmark.ips do |x|
36
+ x.report('String#+') { slow_plus(size, rand_size) }
37
+ x.report('String#concat') { slow_concat(size, rand_size) }
38
+ x.report('String#append') { slow_append(size, rand_size) }
39
+ x.report('"#{\'foo\'}#{\'bar\'}"') { fast_interpolation(size, rand_size) }
40
+ x.compare!
41
+ end
42
+
43
+ # Benchmark.ips do |x|
44
+ # puts '------------------------------+ chunk----------------'
45
+ # x.report('String#+') { str_gen(size, rand_size ) + chunk_gen(chunk_size) }
46
+ # x.report('String#concat') { str_gen(size, rand_size ).concat chunk_gen(chunk_size) }
47
+ # x.report('String#append') { str_gen(size, rand_size ) << chunk_gen(chunk_size) }
48
+ # x.report('"#{\'foo\'}#{\'bar\'}"') { "#{str_gen(size, rand_size )}#{chunk_gen(chunk_size)}" }
49
+ # x.compare!
50
+ # end
51
+ #
52
+ # Benchmark.ips do |x|
53
+ # puts '------------------------------chunk +----------------'
54
+ # x.report('String#+') { str_gen(size, rand_size ) + chunk_gen(chunk_size) }
55
+ # x.report('String#concat') { str_gen(size, rand_size ).concat chunk_gen(chunk_size) }
56
+ # x.report('String#append') { str_gen(size, rand_size ) << chunk_gen(chunk_size) }
57
+ # x.report('"#{\'foo\'}#{\'bar\'}"') { "#{str_gen(size, rand_size )}#{chunk_gen(chunk_size)}" }
58
+ # x.compare!
59
+ # end
60
+
61
+
62
+ Benchmark.ips do |x|
63
+ puts '------------------------------triple spaced----------------'
64
+ x.report('String#+') { str_gen(size, rand_size ) + ' '+ str_gen(size, rand_size) }
65
+ x.report('String#concat') { str_gen(size, rand_size ).concat(' ').concat( str_gen(size, rand_size ) )}
66
+ x.report('String#append') { str_gen(size, rand_size ) << ' ' << str_gen(size, rand_size ) }
67
+ x.report('"#{\'foo\'}#{\'bar\'}"') { "#{str_gen(size, rand_size )} #{chunk_gen(chunk_size)}" }
68
+ x.compare!
69
+ end
70
+
71
+
72
+ Benchmark.ips do |x|
73
+ puts '------------------------------triple spaced----------------'
74
+ x.report('String#+') { str_gen(size, rand_size ) + str_gen(size, rand_size ) + str_gen(size, rand_size) }
75
+ x.report('String#concat') { str_gen(size, rand_size ).concat(str_gen(size, rand_size )).concat( str_gen(size, rand_size ) )}
76
+ x.report('String#append') { str_gen(size, rand_size ) << str_gen(size, rand_size ) << str_gen(size, rand_size ) }
77
+ x.report('"#{\'foo\'}#{\'bar\'}"') { "#{str_gen(size, rand_size )}#{str_gen(size, rand_size )}#{chunk_gen(chunk_size)}" }
78
+ x.compare!
79
+ end
80
+ end
@@ -0,0 +1,25 @@
1
+ require 'benchmark/ips'
2
+
3
+ $str = File.open( './txt' ).readlines.join(' ')
4
+
5
+ # 2 + 1 = 3 object
6
+ def _gsub(str)
7
+ str.gsub( /\s+/, '' )
8
+ end
9
+
10
+ # 2 + 1 = 3 object
11
+ def _gsub!(str)
12
+ str.gsub!( /\s+/, '' )
13
+ end
14
+
15
+
16
+ def test_gsubs( word_count, string_count = 1000 )
17
+ arr = Array.new( string_count ) { $str.split.sample(word_count).join(' ') }
18
+
19
+ Benchmark.ips do |x|
20
+
21
+ x.report('_gsub!') { arr.each{ |str| _gsub!(str) } }
22
+ x.report('_gsub') { arr.each{ |str| _gsub(str) } }
23
+ x.compare!
24
+ end
25
+ end
data/lib/benchmark/txt ADDED
@@ -0,0 +1,748 @@
1
+ CHAPTER ONE
2
+
3
+
4
+
5
+ Haworth
6
+
7
+
8
+
9
+ There was a cold wind this afternoon, but the sun shone for an hour or two. I walked out on the moors behind the house. The sheep were hiding from the wind under the stone walls, and there were grey clouds over the hills to the west. It is only November, but I could smell snow in the air.
10
+
11
+ It will be a cold winter, this year of 1855.
12
+
13
+ My name is Patrick Bronte, and I am seventy-eight years old. I am the rector of the village of Haworth. Haworth is a village of small, grey stone houses on the side of a hill in the north of England, and I live in a house at the top of the hill, next to the church and the graveyard.
14
+
15
+ I walked through the graveyard to the church this afternoon.
16
+
17
+ All my family except Anne are buried there. The wind had blown some dead leaves through the door into the church, and I watched them dancing in the sunlight near the grave. Soon I shall be in that grave with my wife and children, under the cold grey stone and dancing leaves.
18
+
19
+ It is dark outside now, and it is very quiet in this house. Charlotte's husband, Mr Nicholls, is reading in his room, and our servant is cooking in the kitchen. Only the three of us live here now. It is very quiet. I can hear the sounds of the wood burning in the fire, and the big clock on the stairs.
20
+
21
+ There is another sound too - the sound of the wind outside. The wind has many voices. It sings and laughs and shouts to itself all night long. Last night it cried like a little child, and I got out of bed and went to the window to listen.
22
+
23
+ There was no child, of course. Only the wind and the gravestones, cold in the pale moonlight. But I decided then that I would write the story of my children, today, before it is too late. Charlotte's friend, Mrs Gaskell, is writing a book about her, and perhaps she will want to read my story.
24
+
25
+ It is a fine story. It began in April 1820, when we came to Haworth for the first time...
26
+
27
+ There was a strong wind blowing that day too, out of a dark, cloudy sky. We could see snow on the moors. The road to Haworth goes up a hill, and there was ice on the stones of the road. Maria, my wife, was afraid to ride up the hill in the carts.
28
+
29
+ 'We'll walk, children,' she said. 'If one of those horses falls down, there'll be a terrible accident. Come on, let's go and see our new house.'
30
+
31
+
32
+
33
+ She was a small woman, my wife, and not very strong. But she carried the baby, Anne, up the hill in her arms. I carried Emily - she was one and a half years old then. The others walked. My two-year-old son, Patrick Branwell, walked with me, and Charlotte, who was nearly four, walked with her mother. The two oldest children - Elizabeth and Maria - ran on in front. They were very excited, and laughed and talked all the way.
34
+
35
+
36
+
37
+ The people of Haworth came out to watch us. Some of them helped, but most of them just stood in their doorways and watched. They are very poor people, in this village. I was their new rector.
38
+
39
+ We had seven carts to carry our furniture up that icy hill, but it was hard work for the horses. When we reached our house, the wind was blowing hard in our faces. My wife hurried inside, and began to light fires.
40
+
41
+ 'Do you like it, my dear?' I asked her that night, when the children were in bed. She looked pale and tired. I thought it was because of the long journey, and the children. Perhaps it was.
42
+
43
+ She held out her hands to the fire, and said: 'Of course, Patrick. It's a fine house. I do hope it will be a good home for you, and the children.'
44
+
45
+ I was a little surprised by that. 'And for you, Maria,' I said. 'Don't forget yourself. You are the most important person in the world, to me.'
46
+
47
+
48
+
49
+ She smiled then - a lovely smile. 'Thank you, Patrick,' she said. She was a very small woman, and she was often tired because of the children. But when she smiled at me like that, I thought she was the most beautiful woman in England.
50
+
51
+
52
+
53
+ A year and a half later, she was dead.
54
+
55
+ She did not die quickly. She was in bed for seven long months, in awful pain. The doctor came often, and her sister Elizabeth came too, to help. The children were ill, as well. It was a terrible time.
56
+
57
+ My wife Maria died in September, 1821. She was thirty-eight. It was my job to bury her in the church. Our six young children stood and watched quietly.
58
+
59
+ Afterwards, we went back to the house. I called them into this room and spoke to them.
60
+
61
+ I said: 'You must not cry too much, my dears. Your mother is with God now. She is happy. One day you will all die, and if you are good, you will go to God too.'
62
+
63
+ 'But why?' Maria asked. 'Why did she die now, father? We need her.'
64
+
65
+ 'This world is a hard place, children, and we cannot understand everything that God does. But God loves us, never forget that. Your mother loved you, and perhaps she can see you now. We must all try to work hard, learn as much as possible, and be kind to each other. Will you do that?'
66
+
67
+ 'Yes, father.'
68
+
69
+ They all looked so sad, I remember, and they listened so carefully. Little Emily said: 'Who will be our mother now?'
70
+
71
+ 'Maria is the oldest, so she will help me. You must all listen to her, and do what she says. And your Aunt Elizabeth is here, too. Perhaps she will stay for a while.'
72
+
73
+ Elizabeth did stay. She was older than my wife, and she wasn't married. We called her Aunt Branwell. She came from Penzance in Cornwall, a warm, sunny place by the sea in the south-west of England. It is often cold on the moors behind Haworth, and the winds blow all winter. Aunt Branwell hated Haworth, but she stayed here all her life, to help me with her sister's children. She was a good, kind woman.
74
+
75
+
76
+
77
+ I was very proud of my little Maria. She was only eight years old, but she worked all day like an adult. She helped the little ones to get washed and dressed; she helped them to play and draw and read. She was like a little mother to them.
78
+
79
+
80
+
81
+ She could read very well herself. We always had books and newspapers in the house, and I talked to the children about them every day. I talked to them about adult things: the Duke of Wellington, and the important things that he was doing in
82
+
83
+ London. The children listened carefully, and tried hard to understand. Maria often read to the others from the newspaper, and asked me questions about it. She understood it better than most men.
84
+
85
+ I was sure my children were very clever. But I did not have rune to talk to them all day; I had my work to do. So, in 1824, I sent them to school.
86
+
87
+
88
+
89
+
90
+
91
+ CHAPTER TWO
92
+
93
+
94
+
95
+ Cowan Bridge School
96
+
97
+
98
+
99
+ I was born in a small house in Ireland. There were only two rooms in our house, and I had nine brothers and sisters. My parents were very poor. We had no money, and only a small farm. But we did have a church near us, and that church had a school.
100
+
101
+
102
+
103
+ That school gave me my one chance of success. I worked very hard there, and when I was sixteen, I became a teacher. Then I went to St John's College, Cambridge, to study some more. I became a curate. When I married, I was able to get a good job and a house for my family. I got all that because I worked so hard at school.
104
+
105
+ I wanted my children to go to the best school that I could find. Cowan Bridge School was a school for the daughters of churchmen. It belonged to a churchman - Mr Wilson. He was a good man, I thought. I liked the school, and it was not too expensive. So, in July 1824, I took Maria and Elizabeth there. In September, I took Charlotte and, in November, Emily as well. Emily was just six then, and Charlotte was eight.
106
+
107
+ I remember how quiet the house was that autumn. In the evenings I taught my son, Branwell, and my wife's sister looked after the youngest child, Anne. I often thought about the girls. My eldest, Maria, was a good, clever girl - I thought she must be the best pupil in the school. I waited for her letters, and wondered what new things she was learning.
108
+
109
+ She did tell me some things in her letters, but not enough. She told me she liked the schoolwork, and I was pleased. But she did not tell me about the food, or the cold, or the unkind teachers. Charlotte told me those things, much later. I know Maria did not tell me that the food was often burnt and uneatable, or that they could not sleep because the beds were too cold. She did not tell me that the poor hungry children had to wash with ice in the morning, and walk through wet snow to sit for two hours with icy feet in a cold church on Sundays. She did not tell me that many of the children at the school were ill.
110
+
111
+ You didn't tell me that, did you, Maria? Did you? Or did you try to write something, and stop because you were afraid of the teachers? You were a good, brave child, and I was so proud of you, so pleased because you were at school. I wanted you to learn everything; I didn't want you to be poor like my sisters. God help me, I thought you were happy at Cowan Bridge School!
112
+
113
+ There were no Christmas holidays at the school, and it was too difficult to travel over the cold, windy hills to visit my little girls. So I sat at home here in Haworth, with Aunt Branwell, my son, and the little girl, Anne. Outside, the wind blew snow over the gravestones, and there was ice on our windows.
114
+
115
+ On Christmas Day little Anne looked lonely. She asked me about her sisters.
116
+
117
+ 'Don't worry, my dear,' I said. 'They are happy, with the other girls at school. You shall go to Cowan Bridge, too, when you are older.'
118
+
119
+ I remember how strangely she looked at me then. She was only four, and very pretty. She smiled at me, but her face went very white, and her hands started to shake. I don't know why. I thought she was cold, and I put some more wood on the fire. Then Aunt Branwell read her a story from the Bible, and I forgot about it.
120
+
121
+ In February a letter came. It was in an adult's handwriting, not Maria's. Dear Mr Bronte, it said. I am afraid I have some bad news for you. Many children in the school have been ill, and your daughter Maria...
122
+
123
+ My hand began to shake badly, and I dropped the letter on the floor. As I picked it up, I could see only one word - dead... If your daughter Maria does not come home soon, she will be dead.
124
+
125
+
126
+
127
+ I went over the hills to bring her back. My Maria was in a small bed in a cold room upstairs, coughing badly. Elizabeth and Charlotte and Emily stood beside her, waiting for me. They looked so sad and ill and frightened. I remember the big eyes in their small white faces. But I did not bring them home then; the school doctor said it was not necessary. So I took Maria home across the cold, windy moors to Haworth. I sat beside her in the coach and held her hand all the way. I remember how cold her hand was in mine. Thin cold fingers, that did not move at all.
128
+
129
+
130
+
131
+ It was too late to save her. She lay in bed upstairs for nearly three months, but she was too ill to eat. Her poor face was white, I remember, and it seemed thin and small like a dead child's. Only her eyes looked alive - big dark eyes in a thin white face. 'Don't cry, father,' she said to me once. 'I shall be with mother soon, you know. And with God.'
132
+
133
+
134
+
135
+ I buried Maria beside her mother, and a month later I buried Elizabeth there, too. She became ill at school, and a woman from the school brought her home. I brought Charlotte and Emily home two weeks later. They were here when Elizabeth died. Her body lay all night in a wooden box on the table, and her little sisters and brother kissed her before she was buried.
136
+
137
+
138
+
139
+ I had wanted so much for these two girls, and now I had nothing. I stood in the church, and looked at the summer flowers I had put on their grave. I remembered how my wife had held the girls in her arms, and how she had smiled at me when we looked at them. 'They have come back to you now, Maria,' I said. 'I am sorry. I am so sorry, my love.'
140
+
141
+
142
+
143
+
144
+
145
+ CHAPTER TREE
146
+
147
+
148
+
149
+ The little hooks
150
+
151
+
152
+
153
+ I had four children now - Charlotte, Branwell, Emily and Anne. I did not send them to school again for many years. God's ways are hard to understand, I thought. Perhaps God was not pleased with me; perhaps He wanted Maria and Elizabeth for Himself. I decided to keep the others at home. Aunt Branwell could teach them, and I could help when I had time.
154
+
155
+
156
+
157
+ They were clever children, quick at learning. They loved to write and draw and paint, and they talked all day long. And, thank God, they were not ill. In the afternoons, my servant, Tabby, took them for long walks on the moors behind the house. They walked for miles on the hilltops in the strong clean wind, alone with the birds and the sheep. I think it was good for them.
158
+
159
+ They grew stronger, and there was a bright light in their eyes.
160
+
161
+
162
+
163
+ I was not the only sad father in Haworth. Many, many children died, and I had to bury them all. The water in Haworth was bad, so many children died from illness. And many more died from accidents; I saw a hundred children die from fire. In my house, I was always very careful. I had no curtains, no carpets, because I was afraid of fire. My children never wore cotton clothes, because they burn so easily.
164
+
165
+
166
+
167
+ One day in 1826 I brought a box of toy soldiers home from Leeds. Next morning the children began to play games with them.
168
+
169
+
170
+
171
+ 'This one is mine!' Charlotte said. 'He's the Duke of Wellington!'
172
+
173
+ 'And this is mine!' said Branwell. 'He's Napoleon Bonaparte!' The children liked the wooden soldiers and began to tell a story about them. It was a very exciting story, I remember. They read it to me and Aunt Branwell and Tabby, our servant. The next day they invented another story, and then another. And then for several days the children were very quiet, and I wondered what they were doing.
174
+
175
+
176
+
177
+ I went upstairs, and opened their bedroom door. Inside, they were all busily writing or drawing on small pieces of paper. The wooden soldiers were in the middle of the room in front of them.
178
+
179
+ 'What are you doing?' I asked.
180
+
181
+ Emily looked up. 'Oh, father, please go away,' she said. 'We're writing our secret books.'
182
+
183
+ I suppose I looked sad. 'What? Can't I see them?' I asked.
184
+
185
+ They all thought for a minute. Then Charlotte said, very seriously: 'You can see some of them, of course, papa. But they aren't easy to read, because it's very small writing. We'll show them to you when we are ready.'
186
+
187
+ These toy soldiers opened a new world for my children. They showed me some of their stories, but there were hundreds that they kept secret. They all began writing so young - Charlotte, the oldest, was only ten, and Emily was eight. I don't think they ever stopped. Mr Nicholls has all Charlotte's little books now, in a cupboard in his room. Some of them are no more than five or six centimetres high. They are beautifully made, and full of small pictures and tiny writing. There is one on my desk now, but I can't read it, my eyes are too bad.
188
+
189
+
190
+
191
+ Charlotte and Branwell wrote about a country called Angria, while Emily and Anne wrote about a land called Gondal. The people in those countries fought battles and fell in love, and wrote letters and poems. My children wrote these poems and letters, and they wrote books about Angria and Gondal. They drew maps of the countries, wrote newspapers about them, and drew pictures of the towns and people in their stories. They invented a new world for themselves.
192
+
193
+
194
+
195
+ They wrote many of these stories when I was in bed. I used to read to the family, and pray with them in the evening, and then I usually went to bed at nine o'clock. One night, I remember, I woke up and came down again at ten. There was a noise in my room - this room where I am writing now. I opened the door and saw Charlotte and Branwell with a candle, looking at a picture on my wall.
196
+
197
+ 'What are you doing here?' I asked.
198
+
199
+ 'We're looking at the picture, papa,' Branwell said. 'It's the Duke of Zamorna and the Duke of Northangerland fighting in Glasstown.'
200
+
201
+ I looked at the picture. It's here now behind me. It's a picture of a story in the Bible, with a town, mountains, and hundreds of people in it. 'What do you mean?' I asked.
202
+
203
+ 'It's one of our stories, papa,' Charlotte said. 'We have to come in here to look at the picture. Then we invent what happens.'
204
+
205
+ 'Tell me, then,' I said. They both looked very excited; their faces were pink, and their eyes were bright in the candlelight. But they looked happy too. I put my candle on the table, and sat down here, where I am sitting now, to listen to their story.
206
+
207
+ It was a wonderful story. Charlotte's wooden soldier, the Duke of Wellington, had had a son, Arthur, Duke of Zamorna. Branwell's toy soldier, Bonaparte, had become the strong, bad, good-looking Duke of Northangerland. The two Dukes were fighting a terrible battle in a city called Glasstown. There were soldiers who died bravely, and beautiful women who fell in love. I listened until two o'clock in the morning. There was much more, but I have forgotten it now.
208
+
209
+ But I remember the excitement in my children's faces. Sometimes I thought they could actually see these people, as they talked.
210
+
211
+
212
+
213
+ Next day they said no more about it, and I did not ask. It was their own secret world, and they did not let me into it again. But I was pleased they had told me about it once. And sometimes they showed me drawings of places in Angria or Gondal. All my children could draw and paint beautifully. Charlotte used watercolours, and often spent hours painting small pictures. Branwell used oil-paints as well.
214
+
215
+
216
+
217
+
218
+
219
+ CHAPTER FOUR
220
+
221
+
222
+
223
+ Growing up
224
+
225
+
226
+
227
+ When Branwell was fourteen or fifteen, he did a lot of oil-paintings. He painted people in the village, and it was easy to recognize the faces in the pictures. Later, he did a fine painting of his three sisters. I was very proud of him. We all decided he would become a famous artist.
228
+
229
+
230
+
231
+ Charlotte went to school again when she was fifteen. It was a much better school - Miss Wooler's school at Roe Head. I don't think Charlotte liked school, but she wanted to be a teacher - a governess - so she worked hard. I taught Branwell at home, and Aunt Branwell taught Emily and Anne. The girls and Branwell were learning to play the piano, and Branwell played the music in church.
232
+
233
+
234
+
235
+ Emily and Anne had dogs, and they used to take them for walks on the moors. Anne's dog was called Flossy, and Emily had a big strong one called Keeper. Keeper went everywhere with her - I think Emily loved that dog more than any person. Emily was sometimes a difficult child. She was very shy, and did not often speak to anyone outside the family. When she was older, I sent her to school with Charlotte, but she hated it, so I brought her home and sent Anne instead.
236
+
237
+
238
+
239
+ Branwell was not shy. He could talk to anyone for hours. Everyone in Haworth liked him. I remember the day in 1835 when Branwell went to London. He was eighteen years old, and he was going to the Royal Academy in London to learn to be an artist. He walked down the hill in Haworth with a bag of his best paintings on his back, and everyone in the village came out to see him go. That was a great day for me.
240
+
241
+ Something terrible happened in London, but I don't know what it was. Branwell came back two weeks later, his face white, his clothes dirty. I don't know where he went or what happened in London. He refused to tell me. He just sat upstairs, alone in his room for hours.
242
+
243
+ Later, I paid for a room in Bradford for him to work in. He could paint pictures of famous people there, I thought. It was easy work for him. But he couldn't do it. He spent all my money, and came home again after a while.
244
+
245
+ This was a sad time for me. My eyes were very bad, and I had to pay a young curate to help me with my work for the church. My old servant, Tabby, broke her leg and was very ill. And then one day I got a letter from Miss Wooler's school. My curate read it to me.
246
+
247
+ Dear Mr Bronte, the letter said. I am afraid that your daughter Anne is very ill, and...
248
+
249
+ I don't think I ever moved so fast in all my life. Six hours later, I was at Roe Head. The next day Anne and Charlotte were home.
250
+
251
+ Anne was still alive, thank God! A month later she was well again. Thank God.
252
+
253
+ All my children were safe at home.
254
+
255
+ I was happy to have them here. They were so clever, and kind, and they loved each other so much. But I was an old man with bad eyes, and Aunt Branwell and I had very little money. My children had to find work somewhere, in order to live.
256
+
257
+ But what sort of work could they do?
258
+
259
+
260
+
261
+
262
+
263
+ CHAPTER FIVE
264
+
265
+
266
+
267
+ Looking for work
268
+
269
+
270
+
271
+ I do not remember everything they did.
272
+
273
+ Charlotte and Anne worked as governesses for some months, teaching rich children in big houses, and Branwell got a job like that too, for a while. But they didn't like their work. At home my children were full of talk and laughter, but away from home they were shy, quiet, unhappy.
274
+
275
+ They wrote a lot of letters in their search for work - sometimes to famous people. Branwell wanted to be a writer, so he wrote to writers; but not many of them wrote back. He began to look pale and sad in those days, and he was often in the village pub, drinking and talking to the people there. Then he got a job selling tickets on the railways, and left home.
276
+
277
+ The girls had an idea. I remember the day when they told me about it. Charlotte and Anne were at home on holiday, and we were all in the sitting-room after dinner one evening. Anne was playing the piano, and singing quietly to herself. She was the prettiest of the three girls, I suppose. She had long wavy brown hair, and a gentle, kind face. Emily sat on the floor beside her, stroking the ears of her dog, Keeper. Charlotte sat opposite me on the sofa, like a little child with a serious, thoughtful face. She was the smallest; her feet were no bigger than my hands.
278
+
279
+ She looked at me carefully. 'Papa,' she said. 'We want to start a school.'
280
+
281
+ 'Really, my dear? Where?'
282
+
283
+ 'Here.'
284
+
285
+ 'But Charlotte, my dear, we have no room. This house is full already.'
286
+
287
+ 'Oh, but we could change the house, papa. We could build a schoolroom.'
288
+
289
+ 'Well, yes, I suppose so,' I said. 'But - why do you want to do this? Isn't it better to work as governesses, in some big fine house?'
290
+
291
+ 'Oh no, papa!' All three girls spoke at once. Anne had stopped playing, and Emily looked very angry and frightening. I could see they had thought hard about this.
292
+
293
+ Charlotte said: 'The life of a governess is terrible, papa! A governess has no time of her own, no friends, no one to talk to, and if she gets angry with the children, they just run to their mother. I couldn't possibly be a governess all my life!'
294
+
295
+ 'It's true, papa,' Anne said. 'It's an awful life. We're so lonely away from each other. Why can't we have a school, and all live here? Then we can take care of you and Aunt Branwell when you get old.'
296
+
297
+ I looked at Emily. Her eyes were shining; I could see that the idea was important to her too.
298
+
299
+ 'But why will people send their children here?' I asked. 'Haworth is not a big town, or a beautiful place. How will you find children to teach?'
300
+
301
+ 'We have thought of that too, papa,' Charlotte said. 'We must learn more, and become better teachers. I have spoken to Aunt Branwell, and she will give us the money, if you agree. Emily and I want to go to Belgium, to learn French. If we can speak French well, then parents will send their children to us to learn that.'
302
+
303
+ 'Emily will go?' I said. I looked at her. Emily had only been away from home twice, and each time she had been very unhappy. But now she looked excited.
304
+
305
+
306
+
307
+ 'Yes, papa,' she said. 'I will go. Charlotte is right - we must do something. And this will help us to stay together.'
308
+
309
+
310
+
311
+ 'And Anne?'
312
+
313
+ 'I will stay as a governess with the Robinson family,' Anne said sadly. 'There's not enough money for us all to go, and... the Robinsons are not so very bad.'
314
+
315
+ It was always like that. Anne was a gentle girl; she did not fight as hard as the others. Perhaps her life was easier because of that. I don't know.
316
+
317
+ But I thought it was a wonderful idea. I wrote to Belgium, and found them places in a school in Brussels, which was owned by a Monsieur Heger. I agreed to take the girls there, and for a month I wrote down French words in a little pocket book, to help me on the journey. Then, one afternoon in 1842, we caught the train to London.
318
+
319
+ I had not been to London for over twenty years, and my daughters had never been there. We stayed for three days, and then we took the night boat to Belgium, and arrived at a tall, fine school building in the centre of Brussels.
320
+
321
+ Heger himself was a very polite, friendly man - very kind. He did not always understand my French, but he showed me round the school, and talked a lot, very fast. I smiled, and tried to answer.
322
+
323
+ The two girls were very excited when I left them. As I came home on the boat, I thought: 'This is a good thing, a fine thing, perhaps. My daughters will start a good school, and Haworth will become famous. I hope Branwell can make a success of his life, too. Then my wife Maria will be pleased with us all.'
324
+
325
+
326
+
327
+
328
+
329
+ CHAPTER SIX
330
+
331
+
332
+
333
+ Monsieur Heger and Mrs Robinson
334
+
335
+
336
+
337
+ At first, everything went well. Monsieur Heger wrote to me often. He was pleased with my daughters, he said; they were good pupils. But life at home in Haworth was hard. My curate died, and Aunt Branwell became very ill. Emily and Charlotte came home to see her, but she was dead before they arrived.
338
+
339
+ She was a good woman, Elizabeth Branwell. She kept my home for more than twenty years, and she taught my daughters everything she knew. But she never liked Haworth, I am sure of that. She said it was a cold, miserable place. I hope that God has found somewhere warm and comfortable for her now.
340
+
341
+ But how could I live without her? My eyes were now very bad, and I could not see to read. And our servant Tabby was older than I was. Anne could not help me - she was a governess for the Robinson family, and now Branwell had a job there too, teaching their young son. So Charlotte went back to Brussels alone, this time as a teacher in Monsieur Heger's school. Emily stayed at home to cook and clean for me. She did not like Brussels, she said. She was happy to do the housework, and live at home with Tabby and me.
342
+
343
+ She was a strange, quiet girl, Emily. She was the tallest of the girls, and in some ways she was as strong as a man. She loved to walk by herself on the wild lonely moors, with her dog Keeper running by her side. Sometimes I saw her there, singing or talking quietly to herself, and I thought perhaps she could see the people in her secret world of Gondal, and was talking to them. I know that she spent a lot of time writing alone in her room; and when Anne was at home, she and Emily often talked and wrote about the world of Gondal together.
344
+
345
+
346
+
347
+ There were sometimes dangerous people near Haworth, so I always had a gun in the house. Before my eyes were bad, I taught Emily to shoot - she loved that. Sometimes I used to practise shooting in the garden while she was making bread in the kitchen. I shot first, then I called Emily. She came out, cleaned her hands, picked up the gun, shot, and went back in to finish the bread. She was much better at shooting than I was.
348
+
349
+
350
+
351
+ But by 1844 my eyes were too bad for shooting. Emily cooked, cleaned the house, played the piano. And almost every day she went for long walks on the moors with her dog, Keeper.
352
+
353
+ She loved that dog, but she could be very hard with him, too. We did not let him go upstairs, but one day Tabby found him on my bed. Emily was very angry; her face was white and hard. Keeper was a big, strong dog, but she pulled him downstairs and hit him again and again until the dog was nearly blind. Then she gently washed his cuts herself. He never went upstairs again.
354
+
355
+ Charlotte was another year in Brussels. When she came home, she was quiet and sad. Sometimes she wrote long letters in French to Monsieur Heger, but no letters came from him. But this was a time of hope, too. The girls wrote advertisements for their new school, and sent them to newspapers, and to everybody they knew. It was exciting - they were good advertisements, and we waited for the first children to come.
356
+
357
+ We waited a long time, and Charlotte wrote more advertisements.
358
+
359
+ No children came.
360
+
361
+ Every day Charlotte and Emily waited for a letter from the postman, or for a parent to come to see them. Every day they became more miserable.
362
+
363
+ Anne left her job with the Robinsons and came home to Haworth. A month later Branwell also came home, for a holiday.
364
+
365
+ And then one morning, early, there was a knock on the door. Charlotte ran to open it. But it was not a parent - it was a letter for her brother Branwell. He went upstairs with it, smiling.
366
+
367
+ A few minutes later there was a terrible scream. We ran upstairs to Branwell's room. He lay on his bed, screaming, with a white face and wild dark eyes. The letter was in his hand.
368
+
369
+ 'Branwell! What is it? What's the matter?' I asked.
370
+
371
+ He tore his hair with his hands. 'I'm ill,' he said. 'I'm cold - oh, what does it matter? She doesn't care... I can't see her... Oh, it's all finished now, finished for ever! I'll die without her!'
372
+
373
+ 'Here, Branwell, drink this.' Emily brought him a cup of hot milk, but his hand was shaking and he nearly dropped it.
374
+
375
+
376
+
377
+ Charlotte put her hand on his head. 'He's hot, papa, he's burning,' she said. 'You must go to bed at once, Branwell.'
378
+
379
+ He went to bed, and he lay there, sometimes sleeping, sometimes shouting and crying. I tried to talk to him, but I couldn't understand what he said. Then, later, Anne explained.
380
+
381
+
382
+
383
+ She told us a terrible story. I was so angry! I nearly broke a chair with my hands as I listened. My son Branwell, Anne said, was in love with Mrs Robinson, the rich mother of his pupil. For months this lady had spoken kindly to Branwell, walked with him in the garden, talked to him alone in the evenings. He thought she would marry him when her husband died. And then there were other things, that Anne did not want to speak about.
384
+
385
+ The letter was from Mr Robinson. He was often ill, Anne told us, but his children knew about Branwell and their mother, and the servants knew too, I think. Perhaps Mr Robinson had learnt something from them, or perhaps that woman (I cannot call her a wife) had told him everything. Only one thing was certain - in his letter Mr Robinson had ordered Branwell never to return to his house or to speak to any of his family again.
386
+
387
+ My face was hot and my hands were shaking. I tried to talk to Branwell about it, but it was impossible.
388
+
389
+ 'I love her, papa!' he shouted. 'You don't understand - how can you? You've never seen her!'
390
+
391
+ 'I don't want to see her, my son,' I said. 'I understand that she is a bad, evil woman. I hope that God will punish her and...'
392
+
393
+ 'Don't say that, papa!' he screamed. 'You are talking about the woman I love! She will call me back! I will see her again!'
394
+
395
+ 'I hope you never see her again, my son,' I said. 'You must forget her. Branwell, listen to me...'
396
+
397
+
398
+
399
+ But he did not listen. He ran out of the house. He did not come back until the evening, and then he was drunk. He did not listen that day, or the next day, or any day. He began to drink laudanum as well. I thought he would kill himself.
400
+
401
+
402
+
403
+ So I think Charlotte was pleased that no parents came. No school could have a man like Branwell in it.
404
+
405
+
406
+
407
+
408
+
409
+ CHAPTER SEVEN
410
+
411
+
412
+
413
+ Currer, Ellis, and Acton Bell
414
+
415
+
416
+
417
+ At about this time, in 1845, I was almost blind. I had a new curate to do my work - Arthur Nicholls, a young man of twenty-eight. He came from Northern Ireland like myself. He was a good, hard worker. I spoke in the church on Sundays, but Arthur Nicholls did the rest of my work.
418
+
419
+
420
+
421
+ Branwell became worse and worse. Mr Robinson died in 1846, but Mrs Robinson didn't marry Branwell - oh no! She was a cold wicked woman. She sent my son Branwell away, and later married a rich old man. And so Branwell spent more and more time drinking, and taking laudanum, and walking alone on the moors.
422
+
423
+ When you are blind, you listen to things very carefully. I used to sit alone in my room and listen to the sounds of the wind outside the house. The wind talks and whispers and sings - it has many voices. I listened to the sounds of the clock on the stairs, and the wood in the fire, and the footsteps and voices of the girls walking round the house. They talked a lot to each other, and sometimes I could hear what they said, even when they were in another room.
424
+
425
+ Anne had had a poem published in a magazine, and one day I heard a conversation between Charlotte and Emily. Charlotte had found something that Emily had written, and was talking to her about it.
426
+
427
+ 'But they're wonderful, Emily,' Charlotte said. 'They're much better than mine or Anne's.'
428
+
429
+ 'They're not for people to read,' Emily said. 'They're part of the Gondal story. Nobody would understand them, except me and Anne.'
430
+
431
+ I realized that they were talking about some poems of Emily's. I knew that Emily and Anne wrote a lot about the country of Gondal, but I didn't know much about it. Emily kept all her papers locked in her desk.
432
+
433
+ Charlotte was arguing with her. 'Emily, listen to me! These are fine poems. I think we should put some of them in a book, together with mine and Anne's, and try to publish it. People should read them!'
434
+
435
+ 'No!' Emily shouted. Then her dog Keeper began to bark, and I didn't hear any more. But I think they talked about this again several times. I often heard voices arguing, and usually they never argued about their writing.
436
+
437
+ I wanted to tell them not to do it. I had published several small books myself, but I always lost money. I had to pay the publisher to print the books, and not many people bought them. It's an easy way to lose money. But I was too ill, so I said nothing.
438
+
439
+ I learnt, many years later, that they paid over 30 pounds to have a book of poems printed, and that it sold two copies. I am not surprised that they didn't tell me about it; we had very little money in our house.
440
+
441
+ I began to feel that there was something wrong with my head, as well as my eyes. Several times the postman brought an old packet to our house, which was addressed to a man called Currer Bell. I told him that no Currer Bell lived in Haworth, and sent him away. But then, a month or two later, he came back again, with the same old packet.
442
+
443
+ In the summer of 1846 Charlotte took me to see an eye doctor in Manchester. We stayed in rooms in the town. The doctor decided to operate on my eyes, and the next morning we got up early. I was afraid. Could I hold my head still while the doctor cut into my eyes with a knife? Perhaps the pain would be too terrible. Perhaps I would move, or stand up, or...
444
+
445
+ Charlotte held my hand. As we left our rooms, we met a postman.
446
+
447
+ 'Good morning, Miss,' he said. 'There's a packet here for Currer Bell.'
448
+
449
+ 'Oh... thank you.' Charlotte sounded sad, but she took the packet, and put it in her room. She did not open it. Then we walked to the eye doctor's.
450
+
451
+ The pain was terrible, but it was over in fifteen minutes, and I didn't move. Afterwards, I had to lie on a bed in a dark room. We couldn't go home for a month. A nurse came sometimes, but Charlotte stayed with me all day.
452
+
453
+ I asked her once about the packet. She said: 'Oh, it's for a friend of mine, papa. It had a letter for me in it. I have posted it away again now.'
454
+
455
+ I didn't understand, but I didn't ask again. I lay quietly on my bed most of the day, and Charlotte sat in the next room writing. She wrote very fast, for many hours, and never put her pen down once. She seemed quiet, but strangely happy.
456
+
457
+ I was happy too. The doctor had helped; I could see again. It was wonderful - the colours, the shapes of everything were beautiful. When we came back to Haworth, I could see everything clearly at last - our home, the church, the graveyard, the moors, the faces of my Emily and Anne!
458
+
459
+ And Branwell.
460
+
461
+ Branwell's face looked terrible. White, thin, with big dark eyes and untidy hair. His clothes were dirty, he smelt, his hands shook. All the time he was either shouting or crying. And always, every day, he asked me for money.
462
+
463
+ I let him sleep in my room at night, and he kept me awake for hours talking about Mrs Robinson. I remembered his paintings, his stories, his happy childish laughter. My fine, clever son had become a drunken animal.
464
+
465
+
466
+
467
+ The winter of 1846 was terribly cold. The wind blew snow around the house and over the gravestones. A lot of children died in the village. Anne was ill, Branwell was worse. We lit fires in all the rooms, but there was ice inside the windows in the mornings. I spent most of my time with Branwell, so I didn't think very much about the girls.
468
+
469
+
470
+
471
+ And then, one afternoon, Charlotte came into my room. I was sitting here, in this same chair, beside the fire. She had a book in her hand, and that strange, happy look on her face.
472
+
473
+ 'Papa,' she said. 'I've been writing a book.'
474
+
475
+ I smiled. 'Have you, my dear?' I thought she had written another little book about Angria.
476
+
477
+ 'Yes, and I want you to read it.'
478
+
479
+ 'Oh, I'm afraid it will hurt my eyes too much.' My eyes were much better, but the tiny writing in the Angria books was too small for me.
480
+
481
+ 'Oh no,' she said. 'It's not in my handwriting; it is printed.' She held out the book in her hand.
482
+
483
+ 'My dear! Think how much it will cost! You will almost certainly lose money, because no one will buy it! No one knows your name!'
484
+
485
+ 'I don't think so, father. I didn't pay to get it printed, you know. The publishers paid me. Listen to what people say about it in these magazines.'
486
+
487
+ She sat down, and read to me from some of the most famous magazines in England. There were long articles in them, about a book called Jane Eyre, by Currer Bell. They were kind articles; most of the magazine writers liked the book.
488
+
489
+ 'This Currer Bell, then,' I asked. 'Is it you?'
490
+
491
+ Charlotte laughed. 'Yes, papa. It's a man's name, with the same first letters: CB - Charlotte Bronte, Currer Bell.'
492
+
493
+ She gave me the book, and went out. I began to read.
494
+
495
+ I think I read for two hours, but it seemed like ten minutes. It was a wonderful, beautiful book-the story of a little girl called Jane Eyre. Her parents are dead, so she lives with an unkind aunt and her children. Then Jane goes away to a school called Lowood. This school is a terrible place, and it is very like the school at Cowan Bridge. Jane Eyre's best friend, Helen Burns, falls ill at the school, and dies. This Helen is just like my own little Maria. When I read about her death, my eyes filled with tears. But it was a beautiful book, too; I did not want to put it down.
496
+
497
+ At five o'clock I got up and went into the sitting-room. My three daughters sat there waiting for me. Their eyes were very bright. I still had tears in my eyes, but I had a big smile on my face too. I held up Jane Eyre in my hand, and said: 'Girls, do you know Charlotte has written a book? And it is more than good, you know - it is very, very fine indeed!'
498
+
499
+
500
+
501
+
502
+
503
+ CHAPTER EIGHT
504
+
505
+
506
+
507
+ The best days, and the worst days
508
+
509
+
510
+
511
+ Emily and Anne did know, of course. They had known about Charlotte's book for a long time. Jane Eyre was not the first book that Charlotte had sent to a publisher. Over a year ago she had written another book, The Professor, and sent it to one publisher after another. Each publisher had sent it back, in a packet addressed to Currer Bell. And then Charlotte had sent it, in the same old packet, to another publisher, and then another, and got it back again.
512
+
513
+
514
+
515
+ 'Why didn't you change the paper on the packet, my dear?' I asked.
516
+
517
+ Charlotte smiled. 'I didn't think of it, papa. The worst day was when we were in Manchester, going to the eye doctor. Do you remember? The packet came back then. That was the day before I started writing Jane Eyre.'
518
+
519
+ 'Do you mean that you started writing Jane Eyre while I was lying in that dark room in Manchester?'
520
+
521
+ 'That's right, papa.'
522
+
523
+ 'But that's only six months ago, and here is the book in my hand!'
524
+
525
+ 'Yes, papa. The book was printed a month after I sent it to the publisher.'
526
+
527
+ 'My dear! They decided very quickly that they liked it, then!'
528
+
529
+ 'I think they did, papa. After all, it is a good book, isn't it?'
530
+
531
+ She smiled at me. I don't think I have ever seen her so happy. She is a very small person, Charlotte, and not a beautiful woman; but when she smiles like that, her face shines like a fine painting. My wife, Maria, used to look like that sometimes when I first met her.
532
+
533
+ I took her hand in mine. 'It is a very good book, my dear. I cannot tell you how proud I am.'
534
+
535
+
536
+
537
+ She touched my hand. 'Thank you, papa. But you must not be proud of me alone, you know. Anne and Emily-'
538
+
539
+
540
+
541
+ 'Oh no, Charlotte, please!' Emily said.
542
+
543
+ But Charlotte did not stop. '... Anne and Emily have written books too - books just as good as mine - and their books will soon be published as well! Let me introduce you, papa. These young ladies are not your daughters - they are Acton Bell and Ellis Bell, brothers of the famous writer Currer Bell!'
544
+
545
+ Emily's face was bright red, but Anne and Charlotte started laughing. I was very surprised.
546
+
547
+ 'All three of you!' I said. 'But... but why do you use these strange names?'
548
+
549
+ 'Because people are stupid, papa,' Anne said. 'No one thinks women can write good books, so we have used men's names instead. And now they say that Currer Bell is a writer who understands women very well!' She laughed again.
550
+
551
+ 'My dears, my dears!' I held out my hands to them, and kissed each of them in turn, 'I don't know what to say. I am so pleased for you all. You have made your old papa happy today.' Something in Emily's face stopped me. 'Emily? You will let me read your book, won't you?'
552
+
553
+ She thought for a moment. 'Yes, papa. Of course. But... it's very different from Charlotte's. I'm not sure you'll like it.'
554
+
555
+ 'You yourself are very different from Charlotte, my dear, but I love you both. You must show me the book as soon as it comes - and you too, Anne.'
556
+
557
+ I read both their books that winter. They were very different. Anne's book - Agnes Grey - was the story of an unhappy governess. As I read it, I was sad to think how miserable Anne had been, in a big house away from home, where no one understood her. It was a good book, but it was harder to read than Jane Eyre.
558
+
559
+
560
+
561
+ Emily's book was called Wuthering Heights. It was a terrible, frightening, wonderful story. There is love in it, and hate, and fear, and a man called Heathcliff, who is strong and cruel like the devil himself. I read it late one night when the wind was screaming round the house, blowing snow against all the windows, and sometimes I was afraid. When I got up to go to bed, I saw Emily sitting quietly by the fire. She was stroking her big dog, Keeper, with one hand, and drawing a picture with the other.
562
+
563
+
564
+
565
+ She looked like a quiet, gentle young woman, I thought. Tall, pretty, and also... There was something different about her. Something very strange and very strong. There was something in her that was stronger than any of her sisters, even Charlotte. Something stronger than even me, or her brother Branwell.
566
+
567
+ Much stronger than Branwell.
568
+
569
+ All that year Branwell was very ill. He spent more and more time drinking. He slept most of the day, and was awake half of the night. His face was white, his hands shook when he tried to write. His sisters didn't tell him about their books, or show him the new ones that they were writing. They were afraid that he would be unhappy about their success, because he had wanted to be a writer himself. He made life hard for all of us.
570
+
571
+ In September 1848 he became very ill. He coughed all day and all night. He began to talk of death, and asked us to pray with him. While we stood together, praying, he began to cough again. He fell to the ground. Emily and I put our arms round him, but he couldn't get up. There was blood on his mouth, and on Emily's dress.
572
+
573
+ When he stopped coughing, it was because he had stopped breathing. My only son was dead.
574
+
575
+ We buried him in the church beside his mother and little sisters. It was a cold, rainy afternoon. There were dead wet leaves in the graveyard, and the wind blew rain into our faces. I came back into the house soon afterwards, but Emily walked for an hour or two in the rain with her dog, Keeper. When she came back into the house, her dress was wet through.
576
+
577
+ Several days later Emily became ill. Her face was hot, she couldn't eat, she kept moving round the house. It was difficult for her to breathe, and it took her a long time to climb the stairs. Charlotte felt her heart - it was beating a hundred and fifteen times a minute.
578
+
579
+ 'Let me call a doctor, Emily,' Charlotte said.
580
+
581
+ But Emily refused. 'If he comes, I won't talk to him.'
582
+
583
+ 'Then go to bed and rest, please. I can light a fire in your room, and bring you milk and read to you if you like. You need rest, sister!'
584
+
585
+ 'I... do... not!' said Emily slowly. She had to breathe hard between each word, and her face was as white as Branwell's had been. 'My body... doesn't... matter now. I don't... care... about it. I'll live... as I always... have.'
586
+
587
+ And so, every day, she got up at seven o'clock, dressed herself, and stayed downstairs until ten at night. She ate little or nothing, and coughed for hours. Sometimes she coughed blood. She never went out of the house, but one day Charlotte brought some heather from the moors for her to look at. Emily was lying on the black sofa in the sitting-room. Her dog, Keeper, lay on the floor in front of her.
588
+
589
+ 'Look, Emily,' Charlotte said. 'I've found some purple heather for you. There are still one or two flowers left on the moor.'
590
+
591
+ 'Where?' Emily asked.
592
+
593
+ 'Here. Look.' Charlotte held out the small, bright purple flower.
594
+
595
+ Emily turned and looked at Charlotte, but I don't think she could see the heather. Her eyes were too bad. Charlotte put it in Emily's hands, but after a moment Emily dropped it on the floor.
596
+
597
+ At last she said: 'Charlotte, I... will see... the doctor now. If he... comes.' Then she closed her eyes.
598
+
599
+ Emily was so thin, and her white skin looked like paper. I knew it was too late, but I said to Anne: 'Quick! Put on your coat and fetch him, now!'
600
+
601
+ We did not have long to wait.
602
+
603
+ The doctor came, half an hour later, to tell us what we already knew. Emily, my daughter, was dead.
604
+
605
+ 1848 was a year of funerals. I buried many children from the village that year. There was a lot of sadness in Haworth. As I came out of the church with the dead flowers from Emily's grave, I saw three other families walk past me. They had come to visit the graves of their own dead children.
606
+
607
+
608
+
609
+ The people understood that their children were with God, but no one could explain that to Emily's dog, Keeper. He followed us to her funeral, and for weeks afterwards, he lay outside her bedroom and howled.
610
+
611
+
612
+
613
+
614
+
615
+ CHAPTER NINE
616
+
617
+
618
+
619
+ Arthur Nieholls
620
+
621
+
622
+
623
+ That was not the end of my sadness. Anne, too, became ill.
624
+
625
+
626
+
627
+ She could not breathe, she coughed, her face was white. But she was more sensible than Emily. She took all her medicines, and did everything the doctors said. It didn't help much. In the spring she said she wanted to go to the sea, to a warmer place. The doctors told her to wait. I thought she would die before she went.
628
+
629
+ At last, in May, Charlotte went away with her. They went to York first, where they visited a wonderful church, York Minster. 'If men can make something as beautiful as this,' Anne whispered, 'what is God's real home like?'
630
+
631
+ Charlotte told me this in a letter she sent from Scarborough, a town by the sea on the north-east coast.
632
+
633
+ 'On 26th May Anne rode a donkey on the beach,' the letter said. 'She was very happy, papa. Afterwards we went to church and then sat and watched the sea for a long time. On the 28th she was too ill to go out. She died quietly at two o'clock in the afternoon. She will be buried in a graveyard near the sea.'
634
+
635
+ Anne was the baby of the family, the youngest and prettiest of them all. Before she died, she wrote another book-The Tenant of Wildfell Hall - about a woman who left her cruel husband. She was proud of it, and so was I. She was twenty-nine years old. 'I don't want to die, papa,' she said. 'I have too many ideas in my head, too many books to write.'
636
+
637
+ When Charlotte came home the dogs barked happily. Perhaps they thought Anne and Emily and Branwell were coming home too - I don't know. But it was only Charlotte. The smallest of all my children. Not the prettiest, not the strongest, not the strangest. Cod had taken all those for himself. He had left me with the one who would become the most famous. And the one who nearly had a child.
638
+
639
+ Charlotte wrote two more books: Shirley, about a strong brave woman like her sister Emily; and Villette, about love between a teacher and a pupil. But Jane Eyre was her most famous book. Everyone in England talked about it; everyone wanted to read it.
640
+
641
+ Charlotte went to London and met many famous writers. I was very pleased; I loved to hear about the people and places that she saw. But she always came back to Haworth; she didn't like to be with famous people very long. And this quiet place was her home.
642
+
643
+ In 1852, just before Christmas, a terrible thing happened. I heard some of it from my room. My curate, Arthur Nicholls, opened the door to Charlotte's sitting-room, and stood there. His face was white, and he was shaking.
644
+
645
+ 'Yes, Mr Nicholls?' Charlotte said. 'Do you want to come in?'
646
+
647
+ 'No, Miss Charlotte - that is, yes. I mean - I have something important to say to you.'
648
+
649
+ I heard his voice stop for a moment and then he went on. 'I have always... felt strongly about you, Miss Charlotte, and... my feelings are stronger, much stronger, than you know. And, well, the fact is, Miss Charlotte, that... I am asking you to be my wife.'
650
+
651
+ There was a long silence. I heard every word, and I felt cold and angry. Mr Nicholls was a good curate, but that was all. I paid him 100 pounds a year to help me with my work, but he had no place in my house, or in my daughter's bed! I stood up, and opened my door.
652
+
653
+ 'Mr Nicholls!'
654
+
655
+ He turned and looked at me. I could see Charlotte behind him. 'You will leave this house at once, Mr Nicholls. I am very, very angry! You must not speak to my daughter again - ever! Do you understand me?'
656
+
657
+ The stupid man was shaking and almost crying! I thought he was ill. He opened his mouth to speak, but no words came out. Then he turned and went out of the door.
658
+
659
+ Mr Nicholls stayed in his own house for three days. He refused to eat, the stupid man, and he sent me some angry letters. But Charlotte wrote to him, to say that she would not marry him. Then Mr Nicholls said he would leave Haworth, and go to Australia.
660
+
661
+ On his last day, in church, he had to give people bread to eat. But when he held out the bread to Charlotte, he could not do it, because he was shaking and crying so much. Afterwards, the people of Haworth gave him a gold watch. He cried about that, too.
662
+
663
+ I thought it was all finished, but I was wrong. I think he wrote to Charlotte, and she wrote back. In April of 1854, he came back to Haworth. Charlotte brought him into my room. I looked at him, but I said nothing. I was not pleased.
664
+
665
+ 'Papa,' Charlotte said. 'Mr Nicholls and I have something to say to you.
666
+
667
+ I did not like that. 'Mr Nicholls and I...' It did not sound good to me.
668
+
669
+ 'I am busy,' I said. 'I have a lot of work.'
670
+
671
+ Charlotte smiled. 'That's because you don't have a good curate, papa. When Mr Nicholls was here, your life was easy.'
672
+
673
+ 'Perhaps,' I said. 'But he was going to Australia, I thought. Why haven't you gone, sir?'
674
+
675
+
676
+
677
+ Mr Nicholls spoke for the first time. He looked very tall and proud, I thought. 'There are two reasons, sir,' he said. 'First, because I have decided not to go to Australia. And also...'
678
+
679
+
680
+
681
+ He stopped, and looked down at Charlotte. She smiled up at him, and I felt my blood run cold.
682
+
683
+ '... and also, because your daughter Charlotte and I would like to be married. We have come to ask you to agree.'
684
+
685
+ I don't remember what I said next. I think there were a lot of unkind words between us, and some tears. But in the end I agreed. I agreed because Charlotte wanted it, not because of Arthur Nicholls.
686
+
687
+ In June that year they were married in my church. I did not go - I could not give Charlotte away to that man. But he came back here to be my curate, and he and Charlotte lived in this house with me. He is still here now.
688
+
689
+ Perhaps he will read this. If he does, he will know that he was right, and I was wrong. Mr Nicholls was, after all, a good husband for Charlotte. I understood, after a while, that he honestly loved her, and he could make her happy. She began to smile and laugh again. Her eyes shone, she sang sometimes as she worked. Our house became a home again.
690
+
691
+ She went with him to see his family in Ireland, and travelled to the far west of that country. Mr Nicholls did most of my church work for me. Charlotte began a new book - Emma, she called it. And one day in December 1854 she came into my room, smiling. I could see that she was excited.
692
+
693
+ 'What is it, my dear? Have you finished your book?'
694
+
695
+ 'No, not yet, papa. But I have something wonderful to tell you. What do you think?'
696
+
697
+ 'I don't know, my dear. If it's not your book, then...'
698
+
699
+ 'I told Arthur yesterday. I am going to have a child.'
700
+
701
+ I did not say anything. Her hand was on the table and I put my hand on it gently. It was wonderful news. I remembered when my own wife, Maria, had told me this, and how this house had been full of the laughter of little voices, and the noise of running feet. Charlotte and I sat like that for a long time, remembering.
702
+
703
+ It did not happen. At Christmas she fell ill, and in the New Year she was worse. She felt sick all the time because of the baby, and she ate nothing. She lay in bed all day, hot and coughing. Arthur Nicholls cared for her wonderfully - I think he often stayed awake all night. But it did not help.
704
+
705
+ On 31st March 1855 the last of my six children died. It was early in the morning. Arthur Nicholls was sitting by her bed, and I was standing by the door. She was asleep with her hand in his. Her face was very thin and pale.
706
+
707
+ She opened her eyes and saw him. Then she coughed, and I saw fear in her face.
708
+
709
+ 'Oh God,' she whispered. 'I am not going to die, am I? Please don't take me away from Arthur now - we have been so happy.'
710
+
711
+ Those were the last words she ever said. A little while later, I walked slowly out of the house. As I went into the graveyard, the church bell began to ring. It was ringing to tell Haworth and all the world that Charlotte Bronte was dead.
712
+
713
+
714
+
715
+
716
+
717
+ CHAPTER TEN
718
+
719
+
720
+
721
+ Maria
722
+
723
+
724
+
725
+ And so now I have written it. It is three o'clock in the morning. The house is very quiet and the wind has stopped. I can hear the sound of the wood burning in the fire and the clock on the stairs. Somewhere upstairs Arthur Nicholls is sleeping quietly.
726
+
727
+
728
+
729
+ I know that Charlotte's friend, Mrs Gaskell, has nearly finished her book about Charlotte. Perhaps I will show her what I have written.
730
+
731
+ Perhaps. But I don't think so. I wrote to her before, and answered her questions, and that is enough. She is a writer, she can write her own book. I will keep this book in my desk, for myself - and perhaps for Arthur Nicholls. There is no need for other people to read it. My daughter Charlotte is famous already, and when Mrs Gaskell has I wish my wife Maria could read Charlotte's books - and Emily's, and Anne's. Perhaps she can. We had some fine children, didn't we, Maria?
732
+
733
+ I wonder if she can hear me. It is a fine night, now that the wind has stopped. There is a bright moon, and the sky is full of stars. I think I will go outside, and walk through the graveyard to the church, and talk to Maria there.
734
+
735
+
736
+
737
+
738
+
739
+ - THE END -
740
+
741
+ Hope you have enjoyed the reading!
742
+
743
+ Come back to http://english-e-books.net/ to find more fascinating and exciting stories!
744
+
745
+
746
+
747
+
748
+
data/lib/niceql.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require "niceql/version"
2
+ require 'niceql/string'
2
3
 
3
4
  module Niceql
4
5
 
@@ -33,7 +34,7 @@ module Niceql
33
34
  end
34
35
 
35
36
  module Prettifier
36
- INLINE_VERBS = %w(WITH ASC (IN\s) COALESCE AS WHEN THEN ELSE END AND UNION ALL WITH ON DISTINCT INTERSECT EXCEPT EXISTS NOT COUNT ROUND CAST).join('| ')
37
+ INLINE_VERBS = %w(WITH ASC (IN\s) COALESCE AS WHEN THEN ELSE END AND UNION ALL ON DISTINCT INTERSECT EXCEPT EXISTS NOT COUNT ROUND CAST).join('| ')
37
38
  NEW_LINE_VERBS = 'SELECT|FROM|WHERE|CASE|ORDER BY|LIMIT|GROUP BY|(RIGHT |LEFT )*(INNER |OUTER )*JOIN|HAVING|OFFSET|UPDATE'
38
39
  POSSIBLE_INLINER = /(ORDER BY|CASE)/
39
40
  VERBS = "#{NEW_LINE_VERBS}|#{INLINE_VERBS}"
@@ -123,11 +124,12 @@ module Niceql
123
124
  indent = 0
124
125
  parentness = []
125
126
 
126
- #it's better to remove all new lines because it will break formatting + remove any additional formatting with many spaces
127
- # second map! is add newlines at start and begining for all comments started with new line
128
- sql = sql.split( SQL_COMMENTS ).each_slice(2).map{ | crmb, cmmnt |
129
- [crmb.gsub(/[\s]+/, ' '),
130
- cmmnt && ( cmmnt&.match?(/\A\s*$/) ? "\n" + cmmnt[/[\S]+[\s\S]*[\S]+/] + "\n" : cmmnt[/[\S]+[\s\S]*[\S]+/] ) ]
127
+ sql = sql.split( SQL_COMMENTS ).each_slice(2).map{ | sql_part, comment |
128
+ # remove additional formatting for sql_parts but leave comment intact
129
+ [sql_part.gsub(/[\s]+/, ' '),
130
+ # comment.match?(/\A\s*$/) - SQL_COMMENTS gets all comment content + all whitespaced chars around
131
+ # so this sql_part.length == 0 || comment.match?(/\A\s*$/) checks does the comment starts from new line
132
+ comment && ( sql_part.length == 0 || comment.match?(/\A\s*$/) ? "\n#{comment[COMMENT_CONTENT]}\n" : comment[COMMENT_CONTENT] ) ]
131
133
  }.flatten.join(' ')
132
134
 
133
135
  sql.gsub!(/ \n/, "\n")
@@ -135,7 +137,7 @@ module Niceql
135
137
  sql.gsub!(STRINGS){ |str| StringColorize.colorize_str(str) } if colorize
136
138
 
137
139
  first_verb = true
138
- previous_was_comment = false
140
+ prev_was_comment = false
139
141
 
140
142
  sql.gsub!( /(#{VERBS}|#{BRACKETS}|#{SQL_COMMENTS_CLEARED})/) do |verb|
141
143
  if 'SELECT' == verb
@@ -144,6 +146,7 @@ module Niceql
144
146
  add_new_line = !first_verb
145
147
  elsif verb == '('
146
148
  next_closing_bracket = Regexp.last_match.post_match.index(')')
149
+ # check if brackets contains SELECT statement
147
150
  add_new_line = !!Regexp.last_match.post_match[0..next_closing_bracket][/SELECT/] && config.open_bracket_is_newliner
148
151
  parentness << { nested: add_new_line }
149
152
  elsif verb == ')'
@@ -159,26 +162,40 @@ module Niceql
159
162
  else
160
163
  add_new_line = verb[/(#{INLINE_VERBS})/].nil?
161
164
  end
162
- first_verb = false
163
165
 
164
- verb = verb[COMMENT_CONTENT] if verb[SQL_COMMENTS_CLEARED]
165
166
  # !add_new_line && previous_was_comment means we had newlined comment, and now even
166
167
  # if verb is inline verb we will need to add new line with indentation BUT all
167
- # newliners match with a space before so we need to strip it
168
- verb.lstrip! if !add_new_line && previous_was_comment
168
+ # inliners match with a space before so we need to strip it
169
+ verb.lstrip! if !add_new_line && prev_was_comment
170
+
171
+ add_new_line = prev_was_comment unless add_new_line
172
+ add_indent = !first_verb && add_new_line
173
+
174
+ if verb[SQL_COMMENTS_CLEARED]
175
+ verb = verb[COMMENT_CONTENT]
176
+ prev_was_comment = true
177
+ else
178
+ first_verb = false
179
+ prev_was_comment = false
180
+ end
181
+
169
182
  verb = StringColorize.colorize_verb(verb) if !['(', ')'].include?(verb) && colorize
170
- (previous_was_comment || add_new_line ? indent_multiline(verb, indent) : verb).tap{ previous_was_comment = !verb.to_s[SQL_COMMENTS_CLEARED].nil? }
183
+
184
+ subs = ( add_indent ? indent_multiline(verb, indent) : verb)
185
+ !first_verb && add_new_line ? "\n" + subs : subs
171
186
  end
172
- sql.gsub( /\s+\n/, "\n" ).gsub(/\s+\z/, '')
187
+
188
+ # clear all spaces before newlines, and all whitespaces before string end
189
+ sql.tap{ |slf| slf.gsub!( /\s+\n/, "\n" ) }.tap{ |slf| slf.gsub!(/\s+\z/, '') }
173
190
  end
174
191
 
175
192
  private
176
193
  def self.indent_multiline( verb, indent )
177
- # byebug
178
- if verb.match?(/.\n./)
179
- verb.lines.map!{|ln| "\n#{' ' * indent}" + ln}.join
194
+ #
195
+ if verb.match?(/.\s*\n\s*./)
196
+ verb.lines.map!{|ln| "#{' ' * indent}" + ln}.join("\n")
180
197
  else
181
- "\n#{' ' * indent}" + verb.to_s
198
+ "#{' ' * indent}" + verb.to_s
182
199
  end
183
200
  end
184
201
  end
@@ -0,0 +1,5 @@
1
+ class String
2
+ def match?(pattern)
3
+ self =~ pattern
4
+ end
5
+ end unless String.method_defined?(:match?)
@@ -1,3 +1,3 @@
1
1
  module Niceql
2
- VERSION = "0.1.20"
2
+ VERSION = "0.1.21"
3
3
  end
data/niceql.gemspec CHANGED
@@ -36,4 +36,5 @@ Gem::Specification.new do |spec|
36
36
 
37
37
  spec.add_development_dependency "differ"
38
38
  spec.add_development_dependency "pry-byebug"
39
+ spec.add_development_dependency "benchmark-ips"
39
40
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: niceql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20
4
+ version: 0.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - alekseyl
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-02 00:00:00.000000000 Z
11
+ date: 2018-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: benchmark-ips
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  description: 'This is simple and nice sql prettifier, it splits, indent and colorize
84
98
  SQL query and PG error if any '
85
99
  email:
@@ -99,9 +113,13 @@ files:
99
113
  - bin/setup
100
114
  - err_now.png
101
115
  - err_was.png
116
+ - lib/benchmark/cat.rb
117
+ - lib/benchmark/gsub.rb
118
+ - lib/benchmark/txt
102
119
  - lib/generators/niceql/install_generator.rb
103
120
  - lib/generators/templates/niceql_initializer.rb
104
121
  - lib/niceql.rb
122
+ - lib/niceql/string.rb
105
123
  - lib/niceql/version.rb
106
124
  - niceql.gemspec
107
125
  - to_niceql.png