locked
How do I include 3rd party Python modules (NLTK) into a C# application?

    Question

  •  

    Hello,

    I have an embedded Python C# application that uses the NLTK.

    How do I include NLTK into a C# application?

    Thanks.

     

     


    williamj
    Tuesday, June 08, 2010 7:27 PM

Answers

  • I would imagine you need something like IronPython to run the Python code as MSIL. Try http://www.ironpython.net/support/ if you need help in IronPython.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    • Marked as answer by Harry Zhu Tuesday, June 15, 2010 6:44 AM
    Tuesday, June 08, 2010 8:59 PM
  • You can't include Python code in a C# project. The C# compiler does not understand Python. If you want to see if you can include NTLK to a IronPython project, try the link mentioned above. 

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    • Marked as answer by Harry Zhu Tuesday, June 15, 2010 6:43 AM
    Wednesday, June 09, 2010 5:37 PM

All replies

  • I would imagine you need something like IronPython to run the Python code as MSIL. Try http://www.ironpython.net/support/ if you need help in IronPython.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    • Marked as answer by Harry Zhu Tuesday, June 15, 2010 6:44 AM
    Tuesday, June 08, 2010 8:59 PM
  •  

    Yep.

    But how do I include the NTLK modules (in Python)?

    Thanks.

     


    williamj
    Wednesday, June 09, 2010 4:19 PM
  • You can't include Python code in a C# project. The C# compiler does not understand Python. If you want to see if you can include NTLK to a IronPython project, try the link mentioned above. 

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    • Marked as answer by Harry Zhu Tuesday, June 15, 2010 6:43 AM
    Wednesday, June 09, 2010 5:37 PM