Skip to content

TEAMLAB-Lecture/assignment-text-processing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Homework - Text Processing I

๊ฐœ์š”

๋ณธ ๊ณผ์ œ์—์„œ๋Š” string ๋‹ค๋ฃจ๋Š” ๋ฐฉ๋ฒ•์„ ํ•™์Šตํ•ฉ๋‹ˆ๋‹ค. ๋‹ค๋ฅธ ์ž๋ฃŒ๊ตฌ์กฐ๋ฅผ ํ•„์š”์‹œ์— ์‚ฌ์šฉํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค. ๋ณธ ๊ณผ์ œ์—์„œ ํ’€์–ด์•ผ ํ•  ๋ฌธ์ œ๋Š” ์•„๋ž˜ 2๊ฐ€์ง€๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

์ˆ™์ œ ๋‹ค์šด๋กœ๋“œ ๋ฐฉ๋ฒ•

  1. ์•„๋ž˜๋งํฌ๋ฅผ ํด๋ฆญํ•˜์—ฌ ์ˆ™์ œ github repository๋ฅผ ๋ณต์‚ฌํ•จ https://classroom.github.com/a/ZMt5NpxJ
  2. ์•„๋ž˜ ์ฝ”๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ˆ™์ œ ์ฝ”๋“œ github repository๋ฅผ ์ž์‹ ์˜ ์ปดํ“จํ„ฐ๋กœ ํด๋ก ํ•จ
    git clone <๋ ˆํฌ์ง€ํ† ๋ฆฌ URL>
    
  3. ํ•ด๋‹น ํด๋”๋กœ ์ด๋™ํ•˜์—ฌ ์ž์‹ ์˜ ์ฝ”๋“œ๋ฅผ ์ˆ˜์ •ํ•จ

ํ•จ์ˆ˜ ๋ฆฌ์ŠคํŠธ

  • normalize
์ธํ’‹์œผ๋กœ ๋ฐ›๋Š” ์ŠคํŠธ๋ง์—์„œ ์ •๊ทœํ™”๋œ ์ŠคํŠธ๋ง์„ ๋ฐ˜ํ™˜ํ•จ
์•„๋ž˜์˜ ์š”๊ฑด๋“ค์„ ์ถฉ์กฑ์‹œ์ผœ์•ผํ•จ
* ๋ชจ๋“  ๋‹จ์–ด๋“ค์€ ์†Œ๋ฌธ์ž๋กœ ๋˜์–ด์•ผํ•จ
* ๋„์–ด์“ฐ๊ธฐ๋Š” ํ•œ์นธ์œผ๋กœ ๋˜์–ด์•ผํ•จ
* ์•ž๋’ค ํ•„์š”์—†๋Š” ๋„์–ด์“ฐ๊ธฐ๋Š” ์ œ๊ฑฐํ•ด์•ผํ•จ

    Parameters:
        input_string (string): ์˜์–ด๋กœ ๋œ ๋Œ€๋ฌธ์ž, ์†Œ๋ฌธ์ž, ๋„์–ด์“ฐ๊ธฐ, ๋ฌธ์žฅ๋ถ€ํ˜ธ, ์ˆซ์ž๋กœ ์ด๋ฃจ์–ด์ง„ string
        ex - "This is an example.", "   EXTRA   SPACE   "

    Returns:
        normalized_string (string): ์œ„ ์š”๊ฑด์„ ์ถฉ์กฑ์‹œํ‚จ ์ •๊ทœํšŒ๋œ string
        ex - 'this is an example.'

    Examples:
        >>> import text_processing as tp
        >>> input_string1 = "This is an example."
        >>> tp.normalize(input_string1)
        'this is an example.'
        >>> input_string2 = "   EXTRA   SPACE   "
        >>> tp.normalize(input_string2)
        'extra space'
  • no_vowels
์ธํ’‹์œผ๋กœ ๋ฐ›๋Š” ์ŠคํŠธ๋ง์—์„œ ๋ชจ๋“  ๋ชจ์Œ (a, e, i, o, u)๋ฅผ ์ œ๊ฑฐ์‹œํ‚จ ์ŠคํŠธ๋ง์„ ๋ฐ˜ํ™˜ํ•จ

    Parameters:
        input_string (string): ์˜์–ด๋กœ ๋œ ๋Œ€๋ฌธ์ž, ์†Œ๋ฌธ์ž, ๋„์–ด์“ฐ๊ธฐ, ๋ฌธ์žฅ๋ถ€ํ˜ธ๋กœ ์ด๋ฃจ์–ด์ง„ string
        ex - "This is an example."

    Returns:
        no_vowel_string (string): ๋ชจ๋“  ๋ชจ์Œ (a, e, i, o, u)๋ฅผ ์ œ๊ฑฐ์‹œํ‚จ ์ŠคํŠธ๋ง
        ex - "Ths s n xmpl."

    Examples:
        >>> import text_processing as tp
        >>> input_string1 = "This is an example."
        >>> tp.normalize(input_string1)
        "Ths s n xmpl."
        >>> input_string2 = "We love Python!"
        >>> tp.normalize(input_string2)
        ''W lv Pythn!'

์ œ์ถœ๋ฐฉ๋ฒ•

  1. ์ˆ™์ œ ์ฝ”๋“œ๋ฅผ ์ˆ˜์ •ํ•œ ํ›„ commit ์ˆ˜ํ–‰
    git add *.py
    git commit -m "Update my code"
    
  2. ์ž์‹ ์˜ code repository์— ์ฝ”๋“œ๋ฅผ pushํ•จ
    git push origin main
    
  3. ์ž์‹ ์˜ ์ฝ”๋“œ๊ฐ€ all pass๋ฅผ ๋ฐ›์•˜๋Š”์ง€ ํ™•์ธํ•จ

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages