Qwasar - Io - Keep Growing - Williams - G

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

78)9):

! !"##$%&'()*"#%"+,*-$.,"/ !
!"#$%&'&%0$1)%2'*#0%+3'42%15
)"5$)3%678

!"#$%&'(

()*+,-.

8&-+495/+:

3;;/5/+:#4&<)$+9%0)$&=8>

My Ngram
Remember to git add && git commit && git push
each exercise!

We will execute your function with our test(s),


please DO NOT PROVIDE ANY TEST(S) in your file

For each exercise, you will have to create a folder


and in this folder, you will have additional files that
contain your work. Folder names are provided at
the beginning of each exercise under submit
directory and specific file names for each
exercise are also provided at the beginning of each
exercise under submit file(s) .

My Ngram

Submit
.
directory

Submit
Makefile - *.c - *.h
files

It needs to be
completed in the
language you are
working on right now. If
you are doing Bootcamp
Javascript, then
javascript (file extension
Languages
will be .js). If you are
doing Bootcamp Ruby,
then Ruby (file
extension will be .rb). It
goes the same for
Python, Java, C++, Rust,
...

Description

SPECIFICATIONS

Write a program my_ngram; It will count the


number of occurrences per character.

NAME

my_ngram

SYNOPSIS

my_ngram text [text2, text3]

DESCRIPTION

In computational linguistics and probability, an n-


gram is a contiguous sequence of n items from a
given sample of text or speech. The items can be
phonemes, syllables, letters, words or base pairs
according to the application. The n-grams typically
are collected from a text or speech corpus. When
the items are words, n-grams may also be called
shingles.

Google Inc. has used this technique to improve the


completion of its Search Engine. The program was
developed by Jon Orwant and Will Brockman and
released in mid-December 2010.

My Ngram will take 1 or multiple strings as


arguments.

It will display, one per line, each character and the


numbers of times it appears.

Order will be alphanumerical.

Example 00

$>./my_ngram "abcdef"
a:1
b:1
c:1
d:1
e:1
f:1
$>

Example 01

$>./my_ngram " "


:8
$>

8 spaces :-)

Example 02

$>./my_ngram "aaabb" "abc"


a:4
b:3
c:1
$>

Technical information:

1. (If you are doing this as project) you must


create a Makefile, and the output is the
command itself
2. You can use:

printf(3)
write(2)

3. You can NOT use:

Any functions/syscalls which does not appear


in the previous list
Yes, it includes exit
Multiline macros are forbidden
Include another .c is forbidden
Macros with logic (while/if/variables/...) are
forbidden

Requirements

Your code must be compiled with the flags -


Wall -Wextra -Werror.
Your makefile must have a clean & fclean rules.

Example of some rules for Makefiles:

all : $(TARGET)

$(TARGET) : $(OBJ)
gcc $(CFLAGS) -o $(TARGET)
$(OBJ)

$(OBJ) : $(SRC)
gcc $(CFLAGS) -c $(SRC)

clean:
rm -f *.o

fclean: clean
rm -f $(TARGET)

re: fclean all

Warnings

It's a bad practice to submit "object/binary files".


Gandalf will reject your project if you submit your
binary. (with the following message: "pushed file
wrong format")

Ganfalf issue

Gandalf is sending an extra '"', please add a if !=


from '"' in order to pass the project.

!"#$%"&'!(#$(%
" /01)2341056.718393:;,-,5*,03<=>
<=<<3??@<A65B

?+@/: !"#$%&

A:./5);&5B9$&,#%C

!
"/44/#*$D@

E:0)&6+9%&@%+9F&/$&0+*F4)5)G&4+0H&/5C

" '()*+

# ',&-&%&'./)01

# A:&7%+@%)$$

$ -92*/55);

% ()$5&<)./)"

& I/:/$B);

)&*"'+"%,-#.'"#'$/(
0%"1(2$

J+%#6).D,

B#6/52+6DK

,+4#%/:'D#

#29'+:9"DH

#$H#%+.D$#

*9*/:L94D2

+2/#%#:;D*

+49"#$)9D%

0B%/$5+FDF

;+;+'/2%D/

@2#J#2/#DB

+4#J9*+HD,

,#%9HD:

+%#:6)DF

+4#59:J/DB

#;)H9:4)D:

4#/M)%D+

+*+'#5#@D+

#B*);D#

#;)2/6/D+

34*$'5#-*/(6

*#%9,2+6D*

59%$9:+D,#

$+5/4.+4D#

*/%$#K#5D*

)%@#$B)D;#

);/4+.D;

*#*#$+4/D$

2#6;944#D#

#2;94K#/DJ

#2;9%#K/D9

H#%/*+.#D$

J+4;#$2#D#

J9%$9:+.D,

@+;"/:D"

#;);+59:D)

#;)"#4)D5

MB9*#@#MD#

*9%#5+./D#

$#/5+.D$#

5/*#HD5

(6F) !"#$%&'

N%+9F&-/M) ()!*"'+&+,*-'.

<)./)"&$6$5)* /%.')0%1+%2)34*-5*678

O/P09456 9-+'+*'+#-

3.)%#@)&;9%#5/+: :);%%<

!"#$#%&'&()%*$&+,&-)%./0)&'&1)2&300)$$/2/4/56&'&7%/.#06
7+4/06&

You might also like