Giter Site home page Giter Site logo

koreanf2i's People

Contributors

fromsun2moon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

koreanf2i's Issues

TypeError: sequence index must be integer, not 'slice'

[해결법]: 라이브러리 설치시, 최신 버전이 아닌 지정해준 버전을 설치하세요.


안녕하세요, 저는 대학생 박지열이라고 합니다. 우선 좋은 취지의 오픈 소스 감사드립니다.

하지만 사용하고자, test.py 를 실행시켰더니 제목과 같은 오류가 발생했습니다. 제가 디버깅해본 결과, changer.py 에서 token 에 접근하는 방식에서 TypeError 가 발생하는 것을 확인했습니다.

if token[:2] in lk: -> TypeError: sequence index must be integer, not 'slice'

확인해보니, 의도하는 바가 무엇인지 알겠으나 지금은 사용할 수 없는 형식인 듯 합니다.

print(token[0]) # '그랜드'
print(token[1]) # 'NNG'
print(token[:2]) # TypeError!!

저는 임시방편으로 코드를 다음과 같이 수정했습니다.

tmp = []
for token in tokens[0][0]:
    token_tuple = (token[0], token[1]) # token[:2] 대신 새롭게 만든 변수
    if token_tuple in lk:
        #key로 value
        token = informaldic().get(token_tuple)
    if token_tuple in ak:
        token = abnormaldic().get(token_tuple)
    tmp.append(token)

저는 class 에서 slicing 을 하는 방법에 대해서 잘 모르기 때문에, 기회가 되신다면 그쪽을 바꿔서 사용해봐도 좋을 것 같습니다.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.