Find one word that is used three times

Обучайтесь и развивайтесь всесторонне вместе с нами, делитесь знаниями и накопленным опытом, расширяйте границы знаний и ваших умений.

поделиться знаниями или
запомнить страничку

  • Все категории
  • экономические
    43,632
  • гуманитарные
    33,652
  • юридические
    17,917
  • школьный раздел
    611,700
  • разное
    16,898

Популярное на сайте:

Как быстро выучить стихотворение наизусть? Запоминание стихов является стандартным заданием во многих школах. 

Как научится читать по диагонали? Скорость чтения зависит от скорости восприятия каждого отдельного слова в тексте. 

Как быстро и эффективно исправить почерк?  Люди часто предполагают, что каллиграфия и почерк являются синонимами, но это не так.

Как научится говорить грамотно и правильно? Общение на хорошем, уверенном и естественном русском языке является достижимой целью. 

I assume that your question means if any of the words in the line exists at least 3 times, then print the line, else discard it. I would use awk, for a more readable and customizable solution:

awk -F '\W+' '{
    delete c; for (i=1;i<=NF;i++) if (length($i) && ++c[$i]==3) {print; next}
}' file

It is a loop for all fields, counting their occurences per line. If any word reaches 3 times, it will print the line, delete the array and go to next line. Also a test for the length of the field exists to avoid printing on any empty fields counted.

Here we can easily customize the meaning of «word» by adding different and/or many field separators, using -F (the standard BREs and EREs are supported). In the above, word separators are all characters except _ and [:alnum:]: awk -F '\W+' or awk -F '[^_[:alnum:]]+', similar to matching word bountaries with grep.

For a human language, we may need different word bountaries, like everything except the letters, like: awk -F '[^[:alpha:]]+' or except letters and digits: awk -F '[^[:alnum:]]+' or to include not only the underscore, but the dash also into words: awk -F '[^-_[:alnum:]]+'.

Without setting -F, only the whitespace characters are used.

Recommended textbook solutions

Ways of the World: A Global History 3rd Edition by Robert W. Strayer

Ways of the World: A Global History

3rd EditionISBN: 9781319022723Robert W. Strayer

232 solutions

America's History for the AP Course 8th Edition by Eric Hinderaker, James A. Henretta, Rebecca Edwards, Robert O. Self

America’s History for the AP Course

8th EditionISBN: 9781457628931 (2 more)Eric Hinderaker, James A. Henretta, Rebecca Edwards, Robert O. Self

470 solutions

America's History for the AP Course 9th Edition by Eric Hinderaker, James A. Henretta, Rebecca Edwards, Robert O. Self

America’s History for the AP Course

9th EditionISBN: 9781319065072Eric Hinderaker, James A. Henretta, Rebecca Edwards, Robert O. Self

961 solutions

U.S. History 1st Edition by John Lund, Paul S. Vickery, P. Scott Corbett, Todd Pfannestiel, Volker Janssen

U.S. History

1st EditionISBN: 9781938168369John Lund, Paul S. Vickery, P. Scott Corbett, Todd Pfannestiel, Volker Janssen

567 solutions

Change,
lump,
drowned, occupy, straight

  1. Glaciers
    provide vital evidence of climate …

What you need is not pills but
a simple … of scene.

If you need money, there’s
some spare … in my coat pocket.

2. Grassland and savannah …
a substantial part of Southern Africa.

It’s a long journey — let’s
take some books to … the children.

The protesting students intend
to … the Holman Building.

3. The vet said the … on the
dog’s face was not cancerous.

She had a … in her throat
and a tear in her eye when she said goodbye.

Get up and do some work, you
lazy …

4. Many of the wildebeest
didn’t make it and … half-way across the river.

My voice was … out by the
sound of builders drilling.

I … my meal in sauce to hide
the bitter taste.

5. The falconer trained the
hawk to fly in a perfectly … line.

So let’s get this … ; you
say you saw the man break in through the window.

Why can’t you just give me a …
answer for once in your life?

31. Comment on the change of meanings in the italicized words.

1. They sat
on the rug before the fireplace, watching the rising tongues
of flame
.
2. He inspired universal confidence and had an
iron nerve
.
3. He was burning
with a desire

to meet his old friends. 4. As I spoke, rage
sparkled

in my eyes. 5. Emotion squeezed
Soames’ heart. 6. Here was the great mysterious city which was still
a
magnet

for her. 7. Carrie’s anger melted
on the instant. 8. Some books are to
be tasted
,
others swallowed,
and some few to
be chewed
and
digested.

32. Define the meanings of the italicized words in the following sentences.

1. I began
to search the flat, looking in drawers and boxes to see if I could
find a
key
.
I tumbled with a sort of splash upon the
keys

of a piano. Now the orchestra is playing yellow cocktail music and
the opera of voices pitches a
key
higher.

2. I sat
down with my
head

in my hands, until I heard the phone taken up inside and the butler’s
voice calling a taxi. G.Quarterman possessed more power than many
heads
of the state.

3. I walked
into Hyde Park, fell
flat upon the grass and almost immediately fell
asleep.

4. Her
mouth

opened crookedly half an inch, and she shot a few words at one like
pebbles. Would you like me to come to the
mouth

of the river with you? I put the letter into the
mouth

of the box and let it go.

Homonyms Homographs

33. How would you pronounce each of the underlined words in the sentences below? Chose a word with a similar sound from the brackets.

1.
The girl I live
with knows a good pub with live
music. (dive/give)

2.
The main house
houses
a collection of rare stamps. (mouse/rouse)

3.
They bathed
the children after they had bathed
in the sea. (lathe/path)

4.
You sow
the seeds while I feed the sow.
(cow/glow)

5.
The violinist in the bow
tie took a bow.
(allow/flow)

6.
He’s the lead
singer in the group ‘Lead
piping’. (head/deed)

7.
What a row
from the last house in the row!
(plough/though)

8.
Does he still suffer from his war wound?
(found/mooned)

9.
I wound
the rope around the tree to strengthen it against the gale.
(round/tuned)

10.
It’s quite hard to wind
in the sails in this wind.
(find/tinned)

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]

  • #
  • #
  • #
  • #
  • #
  • #
  • #
  • #
  • #
  • #
  • #

Cloudy-aw


  • #1

Hello friends,

I need your help with the following problem.
There are three sentences, with a gap in each of them.
I need to find the one single word (and only one) which can fill all the three gaps and fit properly.

1. I’m sure Maria will ………. for the beach as soon as she’ll be unpacked.

2. How do you think Frizt will …….. each month, with his new job ?

3. He’s achieving great results, I’m sure the management will ……. him sales manager next year.

I couldn’t find anything better than «head», but I’m pretty sure it’s wrong.
A guy who was at the exam with me tried «drive», which is also wrong.
Any suggestions ?

Ciao
Claudio

  • la grive solitaire


    • #2

    Hi Claudio,

    Is there a word missing from the second sentence?

    • #3

    Cloudy-aw said:

    Hello friends,

    1. I’m sure Maria will ………. for the beach as soon as she’ll be unpacked.

    Can future tense be after as soon as?
    If my memories serve me right, my teacher said never.

    la grive solitaire


    • #4

    You’re right, Erik.:) It should read:

    1. I’m sure Maria will …….. for the beach as soon as she’s [she has] unpacked.

    Neever


    • #5

    Hi Claudio,

    I can’t find a word that does all three, but I have to say, sentences 1 and 2 sound wrong regardless. «as soon as she’ll be unpacked» is ungrammatical, like you said, and «each month, with his new job ?» seems to have a misplaced comma, and at first glance «with» is incorrect too. «In» would work better, as long as the missing word doesn’t change the structure. Mind you, my observation still doesn’t help much! Sorry!

    la grive solitaire


    • #6

    I think the missing word for all three is «make»:

    …she’ll make for the beach

    How much will Fritz make each month

    …management will make him sales manager…

    • #7

    Cloudy-aw said:

    Hello friends,

    I need your help with the following problem.
    There are three sentences, with a gap in each of them.
    I need to find the one single word (and only one) which can fill all the three gaps and fit properly.

    1. I’m sure Maria will ………. for the beach as soon as

    she’ll be

    she has unpacked.

    2. How do you think Frizt will …….. each month, with his new job ?

    3. He’s achieving great results, I’m sure the management will ……. him sales manager next year.

    I couldn’t find anything better than «head», but I’m pretty sure it’s wrong.
    A guy who was at the exam with me tried «drive», which is also wrong.
    Any suggestions ?

    Ciao
    Claudio

    Hello Claudio,

    The obvious answer, to me, is «make». But, as La Grive says, there seems to be something missing in the second sentence. That would need the addition of «out» — «How do you think Fritz will make out each month . . . ?»

    Regards,
    LRV

    Joelline


    • #8

    Cloudy-aw said:

    1. I’m sure Maria will MAKE for the beach as soon as she HAS unpacked.

    2. How MUCH do you think Frizt will MAKE each month, with his new job ?

    3. He’s achieving great results, I’m sure the management will MAKE him sales manager next year.

    Claudio

    Omitted words and other errors MAKE this difficult to correct!

    Cloudy-aw


    • #9

    Thank you for your kind and prompt replies.

    At the exam I couldn’t take note of the sentences, therefore I obviously stuffed them with errors when I tried (with the only help of my memory) to type them in the first post of this thread.

    Anyway you all agree that the word is «make».
    I have another question : is «make for the beach» a bit colloquial ? I ask because I have never seen such a form. Is it BE ? Or AE ?

    Ciao and thank you again
    Claudio

    • #10

    In BE I say «head for the beach».

    Regards,
    LRV

    • #11

    I agree with Joelline. Even without the mistakes, it is very difficult. I´d guess that «make for» is both BE and AE, though I´ll let the Americams speak for themselves. It´s certainly BE, though a bit unusual, perhaps more written than spoken?

    • #12

    In AE I have heard and understand «make for the beach,» although its not the primary way of saying it. We usually say «head to the beach» or «go to the beach.» I am sure there are other but thats all I can think of at the moment.

    panjandrum


    • #13

    Let me offer sincere sympathy and suggest that you reserve the right to appeal to the European Court of Human Rights. This is cruel and unusual punishment, not a legitimate examination in the use of English.

    I’ll accept that it is possible to use make in each of these sentences. But I stress possible and assert that it is unnatural.

    • #14

    These are questions that come out in FCE, CAE and CPE.

    Here are my attempts:

    1. head

    2. fare

    3. name

    Joelline


    • #15

    Ooops, Cracker Jack,

    Go back and read the nasty directions again. That was our problem: you had to use the 1 word (the same word) in all 3 sentences!

    It is for this reason that the Europeans here will be appealing to the European Court of Human Rights, and the Americans will be appealing to the Supreme Court! This was, indeed, cruel and unusual punishment!

    Best,
    Joelline

    coconutpalm


    • #16

    If the second sentence is «How much do you think he will make each month, with his new job?», is «make» the correct word then?

    Joelline


    • #17

    Hi coconut palm,

    Yes, and that’s what I changed it to in post #8.

    Joelline

    coconutpalm


    • #18

    Oh, I’m sorry that I didn’t notice the quote!
    I promise I will pay more attention next time!
    Thank you, Joelline, for confirming my assumption!

    • #19

    Joelline said:

    Ooops, Cracker Jack,

    Go back and read the nasty directions again. That was our problem: you had to use the 1 word (the same word) in all 3 sentences!

    It is for this reason that the Europeans here will be appealing to the European Court of Human Rights, and the Americans will be appealing to the Supreme Court! This was, indeed, cruel and unusual punishment!

    Best,
    Joelline

    Oh gee!!! Thanks for reminding me Joelline. That was very careless of me. Well, you have all the right to deplore those bastard-examiners. Not just cruel and usual. It is stupid. Go ahead.

    cuchuflete


    • #20

    «Make for» meaning to go to, or head in the direction of, is not
    used with any frequency in AE. It’s found quite a bit in 19th and early 20th century writing, but has fallen out of favor in recent decades.

    Cloudy-aw


    • #21

    cuchuflete said:

    «Make for» meaning to go to, or head in the direction of, is not
    used with any frequency in AE. It’s found quite a bit in 19th and early 20th century writing, but has fallen out of favor in recent decades.

    Except for occasional appearances, one of them being the written part of the CPE exam I tried last week…
    I agree with Cracker Jack’s opinion, although my view is not so mild.

    Ciao
    Claudio

    • #22

    My understanding is that Cambridge questions are tested and a sufficient number of ‘guinea pigs’ must have answered the question for it to have been shown to help in grading candidates’ English ability.

    I don’t feel «make for the beach» is so unusual.

    Joelline


    • #23

    It’s not unusual if you’re reciting dialogue in a WW II movie about the beaches at Normandy! Otherwise, when is the last time you said it or heard someone say it?

    Like this post? Please share to your friends:
  • Find one word that describes you
  • Find one word that can complete the sentences
  • Find one word substitution
  • Find one word in excel
  • Find one word for many words