Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Change test code#1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
gamamoe wants to merge1 commit intomaster
base:master
Choose a base branch
Loading
fromalign-test-interface
Draft

Change test code#1

gamamoe wants to merge1 commit intomasterfromalign-test-interface

Conversation

@gamamoe
Copy link
Member

제가 단위테스트에 익숙하지 않아서 우선 private static method인 expectedResultSet은 내부에 그냥 우겨 넣었습니다 ㅠ
image

@gamamoegamamoe requested a review fromshin285August 25, 2019 10:04
Copy link
Member

@shin285shin285 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

리뷰 하였습니다. 확인부탁드립니다.

gamamoe reacted with thumbs up emoji
// public void testSequentialGet() {
// for (int i = 0; i < KEYS.length; i++) {
// // TODO: 2019-08-23 이 부분이 지금 정상적으로 test가 되어야 기존에 있는 인터페이스를 따라갈 수 있어요.
// final Map<String, Integer> result = dic.get(KEYS[i]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

제가 내용을 명확하게 안 했네요. dic.get(KEYS[i])의 리턴 형태가 Map<String,Integer> 형태가 되어야 합니다.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Test code의 동작을 보면 Key 값이 "10"인 경우 expected value는 0, 1, 10으로 보이는데요. 이 경우 Map으로 반환을 받기 위해서는 MultiValueMap을 사용해야 할까요? 다시 말해서 Key 하나에 대해서 value가 여러 개인 Map의 반환에 대한 인터페이스 정의가 어떻게 되나요?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

KEYS[i] 값이10인 경우에는 result 값에{ 0 : 0 },{1 : 1},{10 : 10} 이 들어가게 됩니다.
현재 test에서는 key 값을 value 값과 같은 값으로 주었습니다. 그러나 value 값을key value * 2로 주었다고 가정하면 이 경우에는 result 값에{ 0 : 0 },{1 : 2},{10 : 20}이 들어가게 될 것입니다.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

아 이해했습니다! 감사합니다


finalSet<Integer>expectedResult =newHashSet<>();
finalStringtargetValue =KEYS[i];
for (intsubStrLen =1;subStrLen <targetValue.length() +1;subStrLen++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

기존 aho-corasick은 현재 노드에서 parent 노드를 계속 tracking하면서 key값을 알 수 있습니다. double-array aho-corasick에서도 parent를 tracking 가능한지 봐야합니다. 그게 안되면 근호님이 쓰신 코드와 같이 입력된 string에서 key에 해당하는 부분을 찾아내야하는데 이렇게 되면 기존 aho-corasick을 사용하고 있는 인터페이스 부분을 많이 수정해야할 것으로 보입니다.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

이 부분은 기존 구현과 더블 어레이 트라이의 내부 구현을 조금 더 봐야될 것 같아요~

@gamamoe
Copy link
MemberAuthor

우선은 해당 브랜치로 수정하는 내역을 계속 푸쉬할게요. 리뷰 감사합니다!

shin285 reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@shin285shin285shin285 left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@gamamoe@shin285

[8]ページ先頭

©2009-2025 Movatter.jp